10 เมษายน 2555

เขียน Python webapp ด้วย Django+Google App Engine+Cloud SQL -part0 สมัครใช้ API

series content :

Update June, 2012

ตอนนี้ Google ประกาศเก็บเงินค่าใช้บริการ Cloud SQL แล้ว
Dear Cloud SQL previewer
As was previously announced, from June 12th 2012 use of the Google Cloud SQL service will be charged.
To continue using your Cloud SQL instances after June 12th 2012, you will need to enable billing for your projects before then by signing in to the Google APIs console and clicking the Billing tab. Once billing is enabled you can choose (or change) the billing plan for your instances from the Cloud SQL tab. Your instances will not be available after June 12th 2012 if you do not enable billing beforehand.
ตั้งแต่วันที่ 12 มิย. 55 ถ้าอยากจะใช้งาน Cloud SQL ต้องเปิด Billing Service มี  Pricing Package คิดตามการใช้งานจริง ถ้าทดลองใช้งานแบบ Per Use Billing Plan จะถูกกว่า

วิธีการสมัครใช้งาน Google Cloud SQL Limited Preview

ตอนนี้ Google เปิดให้ใช้งาน  Cloud SQL  สำหรับ developer ที่สนใจทดสอบเท่านั้น ยังไม่ได้เปิดใช้ 100% ขั้นตอนการสมัครใช้เวลาพอสมควร อธิบายวิธีการสมัครไว้หน่อย

เข้าไปที่หน้า https://code.google.com/apis/console ถ้ายังไม่เคยใช้งานก็ใช้ Gmail Account login

เปิดไปที่แทป Services มองหา Google Cloud SQL



กด Request access.. link ไปที่หน้าฟอร์มสมัครใช้งาน .. (Google Cloud SQL Limited Preview Signup)


*Note* 
Our team will review your enrollment information and respond by email to the address associated with your Google Account.
ขั้นตอนนี้ Google ใช้คนในการ approve ข้อมูลที่เราลงทะเบียน ใช้เวลานานพอควร (รอนานเกือบ 7 วัน! )

ส่วนสำคัญ คือในช่องนี้..
ให้กรอกข้อมูลไปตามจริง ว่าเราสนใจจะใช้งาน Cloud ยังไงบ้าง มีโปรเจคเจ๋งๆ  อะไรน่าสนใจเผื่อจะพิจารณาเร็วขึ้น ^^
......
7 วันผ่านไปไวเหมือนโกหก ในที่สุด Google ก็ติดต่อกลับมาพร้อมกับเปิด API ใช้งาน

API Console
เปิด services ON แล้วเข้าไปที่ dashboard กด New instance..

Create a new instance..

project id :  ตั้งได้ครั้งเดียวห้ามเปลี่ยน ห้ามซ้ำ
instance name : อันนี้สร้างได้หลายอัน
Authenticated application : app_id ของเราที่จะใช้ database นี้สร้างได้ที่ https://appengine.google.com/ (ใส่เพิ่มทีหลังได้)

จดไว้ก่อน ตอนตั้งค่า database settings.py ของ Django เราจะใช้ชื่อ Instance นี้ในการติดต่อฐานข้อมูล
หลังจาก Create Instance เสร็จจะมาที่หน้า dash board

dash board for instance

ยังไม่ทันสร้าง database เลยใช้พื้นที่ไปแล้ว 82 MB -*- เปิดไป SQL Promt แล้วสั่ง Create database ดู ตรงนี้พิมพ์คำสั่ง My SQL ลงไปได้เลย
SQL Prompt


ตอนนี้เรามี database instance สำหรับทดลองใช้งานกับ app engine แล้ว

to be continue..


reference : https://developers.google.com/cloud-sql/docs/before_you_begin

ไม่มีความคิดเห็น:

แสดงความคิดเห็น