SlideShare a Scribd company logo
Introduction to Google
App Engine (GAE)
Asst. Prof. Dr. Kanda Runapongsa Saikaew
Warakorn Chanprasomchai
Charuwit Nodthaisong
Khon Kaen University
Agenda
● 
● 
● 
● 
● 
● 
● 

What is GAE?
Developing Apps on GAE
Getting started
Using Google authentication on GAE app
Invoking Google Calendar API
Using Google Cloud SQL
Conclusion
What is GAE?
●  Google App Engine lets you run web
applications on Google’s infrastructure
●  App Engine applications are easy to build,
maintain, and scale as traffic and data
storage needs grow
●  With App Engine, there are no servers to
maintain
●  You can serve your app from your domain
name (such as http://www.example.com/) or
using a free name on the appspot.com
Benefits of GAE
●  You only pay for what you use
●  No set-up costs and no recurring fees
●  The resources your application uses, such
as storage and bandwidth, are measured by
the gigabyte, and billed at competitive rates
●  You can control the maximum amounts of
resources your app can consume
●  All applications can use up to 1 GB of
storage and enough CPU and bandwidth to
support an efficient app serving around 5
million page views a month, absolutely free
Developing Apps on GAE
●  Using standard Java technologies
○ 

Support many languages with JVM-based interpreter
or compiler
■  Java, JavaScript, Ruby

●  Using Python runtime environment
○ 
○ 

Once Guido van Rossum, the inventor of Python,
was in the Python App Engine team
First language supported on GAE

●  Using PHP runtime (preview)
●  Using Go runtime environment
(experimental)
Getting Started (1 of 5)
1. Download Google App Engine SDK
https://developers.google.com/appengine/downloads?
hl=th#Google_App_Engine_SDK_for_Python

2. Create a new project using Google Cloud
console
Go to https://cloud.google.com/console
Getting Started (2 of 5)
3. Create GAE Project using the Application
name value the same as Project ID
Getting Started (3 of 5)
4. In the project, you will have these files
automatically created

We need to write main.py
Getting Started (4 of 5)
import webapp2 // python library
class MainHandler(webapp2.RequestHandler):
// Function
def get(self):
// Write “Hello world!” on the web
self.response.write('Hello world!')
app = webapp2.WSGIApplication([
('/', MainHandler)
], debug=True)
Getting Started (5 of 5)
4. Deploy on Google app engine

5. Check the app via the browser
Google Authentication on GAE
●  To make API calls access private data, the
user that has access to the private data must
grant your application access
●  Therefore, your application must be
authenticated, the user must grant access
for your application, and the user must be
authenticated in order to grant that access
●  All of this is accomplished with OAuth 2.0
and libraries written for it.
Google API’s Client Library for Python
●  The Google APIs Client Library for Python has special
support for Google App Engine applications
●  There are two decorator classes to choose from:

• 

OAuth2Decorator: Use the OAuth2Decorator class to
contruct a decorator with your client ID and secret.

• 

OAuth2DecoratorFromClientSecrets: Use the
OAuth2DecoratorFromClientSecrets class to contruct a
decorator using a client_secrets.json file described in
the flow_from_secrets() section of the OAuth 2.0 page
Using Decorators
●  Need to add a specific URL handler to your application
to handle the redirection from the authorization server
back to your application
def main()
application = webapp.WSGIApplication(
[
('/', MainHandler),
('/about', AboutHandler),
(decorator.callback_path,
decorator.callback_handler()),
],
debug=True)
run_wsgi_app(application)
Sample Authentication Code
In the following code snippet, the OAuth2Decorator class
is used to create an oauth_required decorator, and the
decorator is applied to a function that accesses the
Google Calendar API
decorator = OAuth2Decorator(
client_id='your_client_id',
client_secret='your_client_secret',
scope='https://www.googleapis.com/auth/calendar')
service = build('calendar', 'v3')
class MainHandler(webapp.RequestHandler):
@decorator.oauth_required
def get(self):
# Get the authorized Http object created by the
decorator.
http = decorator.http()
...
How to get Client ID and Client
Secret
1. Go to http://code.google.com/apis/console
2. Go to API Access
- Click button “Create Another Client ID...”
3. Fill in information about the application
Invoking Google Calendar API
1.  Go to https://code.google.com/apis/console and click
Services and enable Calendar API
2.  Specify OAuth2 setting and service that we want to call
decorator = OAuth2Decorator(
client_id='194577071906tgj1to860hhjbnjio1mf7ij0pljh77kl.apps.googleusercontent.com',
client_secret='y3gWfp6FIaqiusr7YYViKKPM',
scope='https://www.googleapis.com/auth/calendar')
service = build('calendar', 'v3')

1.  Suppose that we want to create Google calendar event
●  Need to look for request body at
https://developers.google.com/google-apps/calendar/v3/
reference/events/insert
Creating Google Calendar Event
class MainPage(webapp2.RequestHandler):
@decorator.oauth_required
def get(self):
http = decorator.http()
event = {
'summary': 'Google App Engine Training',
'location': 'Thai-Nichi Institute of Technology',
'start': {
'dateTime': '2013-07-20T09:00:00.000+07:00'
},
'end': {
'dateTime': '2013-07-20T16:00:00.000+07:00'
}
}
insert_event = service.events().insert(calendarId='primary',
body=event).execute(http=http)
self.response.write("Create event success with ID: " + insert_event['id'])
The App Asking the User for Permission
Result of Creating Calendar Event
Using Google Cloud SQL
●  Google Cloud SQL is a web service that allows you to
create, configure, and use relational databases that live
in Google's cloud
●  By offering the capabilities of a familiar MySQL
database, the service enables you to easily move your
data, applications, and services in and out of the cloud
●  There is a range of configurations from small instances
costing just $0.025 per hour up to high end instances
with 16GB of RAM and 100GB of data storage.
How to Create a Instance on Cloud SQL
1. Go to Google Cloud Console at http://cloud.google.com
2. Choose project that we want to use Cloud SQL
3. At the side menu, choose Cloud SQL
4. Then click button New Instance
Accessing Cloud SQL (1 of 4)
1. Import library rdbms
from google.appengine.api import rdbms
2. Set up instance name
_INSTANCE_NAME = "virtual-airport-281:prinyaworkshop"
3. Connect to database
conn =
rdbms.connect(instance=_INSTANCE_NAME,
database='Comment')
cursor = conn.cursor()
4.Specify SQL command to use
cursor.execute('SELECT comment, name FROM
comment')
Accessing Cloud SQL (2 of 4)
5. Using templates to display the data obtained from SQL
result
templates = {
'page_title' : 'Template Workshop',
'comment' : cursor.fetchall(),
}
{% for row in comment %}
<tr>
<td>{{ row[0] }}</td>
<td>{{ row[1] }}</td>
</tr>
{% endfor %}
Accessing Cloud SQL (3 of 4)
If you find that there is the problem, “The rdbms API is not
available because the MySQLdb library could not be
loaded”,
● 
Type import MySQLdb in file dev_appserver.py
6. You can use any other SQL commands such as
INSERT or DELETE with the function cursor.execute()
cursor.execute("INSERT INTO comment
(comment,name) VALUES (%s,%s)", (comment,
name));
conn.commit();
7. After you finish with all tasks with cloud SQL, you
should issue function close()
conn.close();
Sample Result
●  As the user type comment, and name and click button
Insert data, the app will insert data into Cloud SQL, and
then display the inserted data in the table on the page
Conclusion
●  Google App Engine (GAE) will help
developers to make it easy to build scalable
applications
●  There are two favorite languages for
implementing apps on GAE
○ 

Python and Java

●  To call Google API to access data, need to
use OAuth 2.0
●  To leverage existing relational databases,
should use Cloud SQL
References
https://developers.google.com/appengine/
http://stackoverflow.com/questions/1085898/
choosing-java-vs-python-on-google-appengine
Thank you

• Kanda Runapongsa Saikaew
•  Khon Kaen University, Thailand
•  Assistant Professor of Department of
Computer Engineering
•  Associate Director for Administration,
Computer Center

•  krunapon@kku.ac.th
•  Twitter @krunapon
•  https://plus.google.com/u/

0/118244887738724224199
Ad

More Related Content

What's hot (20)

What is Google App Engine?
What is Google App Engine?What is Google App Engine?
What is Google App Engine?
weschwee
 
What is Google App Engine
What is Google App EngineWhat is Google App Engine
What is Google App Engine
Chris Schalk
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Myles Braithwaite
 
Google App Engine: An Introduction
Google App Engine: An IntroductionGoogle App Engine: An Introduction
Google App Engine: An Introduction
Abu Ashraf Masnun
 
Google app engine - Overview
Google app engine - OverviewGoogle app engine - Overview
Google app engine - Overview
Nathan Quach
 
Google App Engine's Latest Features
Google App Engine's Latest FeaturesGoogle App Engine's Latest Features
Google App Engine's Latest Features
Chris Schalk
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Csaba Toth
 
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Naga Rohit
 
Google app engine introduction
Google app engine introductionGoogle app engine introduction
Google app engine introduction
rajsandhu1989
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
Chakkrit (Kla) Tantithamthavorn
 
App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010
Chris Schalk
 
Google app engine
Google app engineGoogle app engine
Google app engine
Lukasz Dynowski
 
Google App Engine (Introduction)
Google App Engine (Introduction)Google App Engine (Introduction)
Google App Engine (Introduction)
Praveen Hanchinal
 
Google App Engine - Overview #3
Google App Engine - Overview #3Google App Engine - Overview #3
Google App Engine - Overview #3
Kay Kim
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
Brian Lyttle
 
App Engine
App EngineApp Engine
App Engine
GirdhareeSaran
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
Colin Su
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Colin Su
 
Google Application Engine
Google Application EngineGoogle Application Engine
Google Application Engine
guestd77e8ae
 
Meteor Introduction - Ashish
Meteor Introduction - AshishMeteor Introduction - Ashish
Meteor Introduction - Ashish
Entrepreneur / Startup
 
What is Google App Engine?
What is Google App Engine?What is Google App Engine?
What is Google App Engine?
weschwee
 
What is Google App Engine
What is Google App EngineWhat is Google App Engine
What is Google App Engine
Chris Schalk
 
Google App Engine: An Introduction
Google App Engine: An IntroductionGoogle App Engine: An Introduction
Google App Engine: An Introduction
Abu Ashraf Masnun
 
Google app engine - Overview
Google app engine - OverviewGoogle app engine - Overview
Google app engine - Overview
Nathan Quach
 
Google App Engine's Latest Features
Google App Engine's Latest FeaturesGoogle App Engine's Latest Features
Google App Engine's Latest Features
Chris Schalk
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Csaba Toth
 
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Naga Rohit
 
Google app engine introduction
Google app engine introductionGoogle app engine introduction
Google app engine introduction
rajsandhu1989
 
App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010App Engine Overview @ Google Hackathon SXSW 2010
App Engine Overview @ Google Hackathon SXSW 2010
Chris Schalk
 
Google App Engine (Introduction)
Google App Engine (Introduction)Google App Engine (Introduction)
Google App Engine (Introduction)
Praveen Hanchinal
 
Google App Engine - Overview #3
Google App Engine - Overview #3Google App Engine - Overview #3
Google App Engine - Overview #3
Kay Kim
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
Brian Lyttle
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
Colin Su
 
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API DevelopmentIntroduction to Google Cloud Endpoints: Speed Up Your API Development
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Colin Su
 
Google Application Engine
Google Application EngineGoogle Application Engine
Google Application Engine
guestd77e8ae
 

Viewers also liked (7)

Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
Stefan Christoph
 
Create first-web application-googleappengine
Create first-web application-googleappengineCreate first-web application-googleappengine
Create first-web application-googleappengine
marwa Ayad Mohamed
 
Hello World Python featuring GAE
Hello World Python featuring GAEHello World Python featuring GAE
Hello World Python featuring GAE
Maito Kuwahara
 
Google App Engine - Simple Introduction
Google App Engine - Simple IntroductionGoogle App Engine - Simple Introduction
Google App Engine - Simple Introduction
Lenny Rachitsky
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
rajdeep
 
Google app engine
Google app engineGoogle app engine
Google app engine
Suraj Mehta
 
HBase Storage Internals
HBase Storage InternalsHBase Storage Internals
HBase Storage Internals
DataWorks Summit
 
Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
Stefan Christoph
 
Create first-web application-googleappengine
Create first-web application-googleappengineCreate first-web application-googleappengine
Create first-web application-googleappengine
marwa Ayad Mohamed
 
Hello World Python featuring GAE
Hello World Python featuring GAEHello World Python featuring GAE
Hello World Python featuring GAE
Maito Kuwahara
 
Google App Engine - Simple Introduction
Google App Engine - Simple IntroductionGoogle App Engine - Simple Introduction
Google App Engine - Simple Introduction
Lenny Rachitsky
 
Introduction to Google App Engine
Introduction to Google App EngineIntroduction to Google App Engine
Introduction to Google App Engine
rajdeep
 
Google app engine
Google app engineGoogle app engine
Google app engine
Suraj Mehta
 
Ad

Similar to Introduction to Google App Engine (20)

Google Cloud Platform
Google Cloud Platform Google Cloud Platform
Google Cloud Platform
Francesco Marchitelli
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
wesley chun
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
wesley chun
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
wesley chun
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
wesley chun
 
Build Android App using GCE & GAE
Build Android App using GCE & GAEBuild Android App using GCE & GAE
Build Android App using GCE & GAE
Love Sharma
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
Gaston Cruz
 
The Glass Class - Tutorial 2 - Mirror API
The Glass Class - Tutorial 2 - Mirror APIThe Glass Class - Tutorial 2 - Mirror API
The Glass Class - Tutorial 2 - Mirror API
Gun Lee
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
firenze-gtug
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
e-Legion
 
Google app engine
Google app engineGoogle app engine
Google app engine
Renjith318
 
Introduction to google endpoints
Introduction to google endpointsIntroduction to google endpoints
Introduction to google endpoints
Shinto Anto
 
Goa tutorial
Goa tutorialGoa tutorial
Goa tutorial
Bruce McPherson
 
File Repository on GAE
File Repository on GAEFile Repository on GAE
File Repository on GAE
lynneblue
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
Luis Valencia
 
Google app engine
Google app engineGoogle app engine
Google app engine
shreyashsrs66
 
Get started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointGet started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePoint
Yaroslav Pentsarskyy [MVP]
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-python
Deepak Garg
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
Natalia Efimtseva
 
Simple stock market analysis
Simple stock market analysisSimple stock market analysis
Simple stock market analysis
lynneblue
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
wesley chun
 
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIsExploring Google APIs 102: Cloud vs. non-GCP Google APIs
Exploring Google APIs 102: Cloud vs. non-GCP Google APIs
wesley chun
 
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...Build an AI/ML-driven image archive processing workflow: Image archive, analy...
Build an AI/ML-driven image archive processing workflow: Image archive, analy...
wesley chun
 
Accessing Google Cloud APIs
Accessing Google Cloud APIsAccessing Google Cloud APIs
Accessing Google Cloud APIs
wesley chun
 
Build Android App using GCE & GAE
Build Android App using GCE & GAEBuild Android App using GCE & GAE
Build Android App using GCE & GAE
Love Sharma
 
Automatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos TabularesAutomatizacion de Procesos en Modelos Tabulares
Automatizacion de Procesos en Modelos Tabulares
Gaston Cruz
 
The Glass Class - Tutorial 2 - Mirror API
The Glass Class - Tutorial 2 - Mirror APIThe Glass Class - Tutorial 2 - Mirror API
The Glass Class - Tutorial 2 - Mirror API
Gun Lee
 
google drive and the google drive sdk
google drive and the google drive sdkgoogle drive and the google drive sdk
google drive and the google drive sdk
firenze-gtug
 
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
e-Legion
 
Google app engine
Google app engineGoogle app engine
Google app engine
Renjith318
 
Introduction to google endpoints
Introduction to google endpointsIntroduction to google endpoints
Introduction to google endpoints
Shinto Anto
 
File Repository on GAE
File Repository on GAEFile Repository on GAE
File Repository on GAE
lynneblue
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
Luis Valencia
 
Get started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointGet started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePoint
Yaroslav Pentsarskyy [MVP]
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-python
Deepak Garg
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
Natalia Efimtseva
 
Simple stock market analysis
Simple stock market analysisSimple stock market analysis
Simple stock market analysis
lynneblue
 
Ad

More from Kanda Runapongsa Saikaew (20)

ความรู้ไอทีช่วยเลี้ยงลูกได้
ความรู้ไอทีช่วยเลี้ยงลูกได้ความรู้ไอทีช่วยเลี้ยงลูกได้
ความรู้ไอทีช่วยเลี้ยงลูกได้
Kanda Runapongsa Saikaew
 
Google Apps Basic for Education
Google Apps Basic for Education Google Apps Basic for Education
Google Apps Basic for Education
Kanda Runapongsa Saikaew
 
Moodle basics
Moodle basicsMoodle basics
Moodle basics
Kanda Runapongsa Saikaew
 
Introduction to JSON
Introduction to JSONIntroduction to JSON
Introduction to JSON
Kanda Runapongsa Saikaew
 
Introduction to Google+
Introduction to Google+Introduction to Google+
Introduction to Google+
Kanda Runapongsa Saikaew
 
ใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัย
ใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัยใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัย
ใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัย
Kanda Runapongsa Saikaew
 
บริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษา
บริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษาบริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษา
บริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษา
Kanda Runapongsa Saikaew
 
Baby Health Journal
Baby Health Journal Baby Health Journal
Baby Health Journal
Kanda Runapongsa Saikaew
 
Using Facebook as a Supplementary Tool for Teaching and Learning
Using Facebook as a Supplementary Tool for Teaching and LearningUsing Facebook as a Supplementary Tool for Teaching and Learning
Using Facebook as a Supplementary Tool for Teaching and Learning
Kanda Runapongsa Saikaew
 
วิธีการติดตั้งและใช้ Dropbox
วิธีการติดตั้งและใช้ Dropboxวิธีการติดตั้งและใช้ Dropbox
วิธีการติดตั้งและใช้ Dropbox
Kanda Runapongsa Saikaew
 
Using Facebook and Google Docs for Teaching and Sharing Information
Using Facebook and Google Docs for Teaching and Sharing InformationUsing Facebook and Google Docs for Teaching and Sharing Information
Using Facebook and Google Docs for Teaching and Sharing Information
Kanda Runapongsa Saikaew
 
เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้
เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้
เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้
Kanda Runapongsa Saikaew
 
การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้
การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้
การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้
Kanda Runapongsa Saikaew
 
คู่มือการใช้ Dropbox
คู่มือการใช้ Dropboxคู่มือการใช้ Dropbox
คู่มือการใช้ Dropbox
Kanda Runapongsa Saikaew
 
การใช้เฟซบุ๊กเพื่อการเรียนการสอน
การใช้เฟซบุ๊กเพื่อการเรียนการสอนการใช้เฟซบุ๊กเพื่อการเรียนการสอน
การใช้เฟซบุ๊กเพื่อการเรียนการสอน
Kanda Runapongsa Saikaew
 
การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์
การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์
การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์
Kanda Runapongsa Saikaew
 
Social Media (โซเชียลมีเดีย)
Social Media (โซเชียลมีเดีย)Social Media (โซเชียลมีเดีย)
Social Media (โซเชียลมีเดีย)
Kanda Runapongsa Saikaew
 
Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)
Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)
Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)
Kanda Runapongsa Saikaew
 
ความรู้ไอทีช่วยเลี้ยงลูกได้
ความรู้ไอทีช่วยเลี้ยงลูกได้ความรู้ไอทีช่วยเลี้ยงลูกได้
ความรู้ไอทีช่วยเลี้ยงลูกได้
Kanda Runapongsa Saikaew
 
ใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัย
ใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัยใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัย
ใช้ไอทีอย่างไรให้เป็นประโยชน์ เหมาะสม และปลอดภัย
Kanda Runapongsa Saikaew
 
บริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษา
บริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษาบริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษา
บริการไอทีของมหาวิทยาลัยขอนแก่นเพื่อนักศึกษา
Kanda Runapongsa Saikaew
 
Using Facebook as a Supplementary Tool for Teaching and Learning
Using Facebook as a Supplementary Tool for Teaching and LearningUsing Facebook as a Supplementary Tool for Teaching and Learning
Using Facebook as a Supplementary Tool for Teaching and Learning
Kanda Runapongsa Saikaew
 
วิธีการติดตั้งและใช้ Dropbox
วิธีการติดตั้งและใช้ Dropboxวิธีการติดตั้งและใช้ Dropbox
วิธีการติดตั้งและใช้ Dropbox
Kanda Runapongsa Saikaew
 
Using Facebook and Google Docs for Teaching and Sharing Information
Using Facebook and Google Docs for Teaching and Sharing InformationUsing Facebook and Google Docs for Teaching and Sharing Information
Using Facebook and Google Docs for Teaching and Sharing Information
Kanda Runapongsa Saikaew
 
เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้
เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้
เครื่องมือเทคโนโลยีสารสนเทศฟรีที่น่าใช้
Kanda Runapongsa Saikaew
 
การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้
การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้
การใช้เฟซบุ๊กเพื่อแลกเปลี่ยนเรียนรู้
Kanda Runapongsa Saikaew
 
คู่มือการใช้ Dropbox
คู่มือการใช้ Dropboxคู่มือการใช้ Dropbox
คู่มือการใช้ Dropbox
Kanda Runapongsa Saikaew
 
การใช้เฟซบุ๊กเพื่อการเรียนการสอน
การใช้เฟซบุ๊กเพื่อการเรียนการสอนการใช้เฟซบุ๊กเพื่อการเรียนการสอน
การใช้เฟซบุ๊กเพื่อการเรียนการสอน
Kanda Runapongsa Saikaew
 
การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์
การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์
การใช้เฟซบุ๊กอย่างปลอดภัยและสร้างสรรค์
Kanda Runapongsa Saikaew
 
Social Media (โซเชียลมีเดีย)
Social Media (โซเชียลมีเดีย)Social Media (โซเชียลมีเดีย)
Social Media (โซเชียลมีเดีย)
Kanda Runapongsa Saikaew
 
Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)
Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)
Mobile Application for Education (โมบายแอปพลิเคชันเพื่อการศึกษา)
Kanda Runapongsa Saikaew
 

Recently uploaded (20)

Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 

Introduction to Google App Engine

  • 1. Introduction to Google App Engine (GAE) Asst. Prof. Dr. Kanda Runapongsa Saikaew Warakorn Chanprasomchai Charuwit Nodthaisong Khon Kaen University
  • 2. Agenda ●  ●  ●  ●  ●  ●  ●  What is GAE? Developing Apps on GAE Getting started Using Google authentication on GAE app Invoking Google Calendar API Using Google Cloud SQL Conclusion
  • 3. What is GAE? ●  Google App Engine lets you run web applications on Google’s infrastructure ●  App Engine applications are easy to build, maintain, and scale as traffic and data storage needs grow ●  With App Engine, there are no servers to maintain ●  You can serve your app from your domain name (such as http://www.example.com/) or using a free name on the appspot.com
  • 4. Benefits of GAE ●  You only pay for what you use ●  No set-up costs and no recurring fees ●  The resources your application uses, such as storage and bandwidth, are measured by the gigabyte, and billed at competitive rates ●  You can control the maximum amounts of resources your app can consume ●  All applications can use up to 1 GB of storage and enough CPU and bandwidth to support an efficient app serving around 5 million page views a month, absolutely free
  • 5. Developing Apps on GAE ●  Using standard Java technologies ○  Support many languages with JVM-based interpreter or compiler ■  Java, JavaScript, Ruby ●  Using Python runtime environment ○  ○  Once Guido van Rossum, the inventor of Python, was in the Python App Engine team First language supported on GAE ●  Using PHP runtime (preview) ●  Using Go runtime environment (experimental)
  • 6. Getting Started (1 of 5) 1. Download Google App Engine SDK https://developers.google.com/appengine/downloads? hl=th#Google_App_Engine_SDK_for_Python 2. Create a new project using Google Cloud console Go to https://cloud.google.com/console
  • 7. Getting Started (2 of 5) 3. Create GAE Project using the Application name value the same as Project ID
  • 8. Getting Started (3 of 5) 4. In the project, you will have these files automatically created We need to write main.py
  • 9. Getting Started (4 of 5) import webapp2 // python library class MainHandler(webapp2.RequestHandler): // Function def get(self): // Write “Hello world!” on the web self.response.write('Hello world!') app = webapp2.WSGIApplication([ ('/', MainHandler) ], debug=True)
  • 10. Getting Started (5 of 5) 4. Deploy on Google app engine 5. Check the app via the browser
  • 11. Google Authentication on GAE ●  To make API calls access private data, the user that has access to the private data must grant your application access ●  Therefore, your application must be authenticated, the user must grant access for your application, and the user must be authenticated in order to grant that access ●  All of this is accomplished with OAuth 2.0 and libraries written for it.
  • 12. Google API’s Client Library for Python ●  The Google APIs Client Library for Python has special support for Google App Engine applications ●  There are two decorator classes to choose from: •  OAuth2Decorator: Use the OAuth2Decorator class to contruct a decorator with your client ID and secret. •  OAuth2DecoratorFromClientSecrets: Use the OAuth2DecoratorFromClientSecrets class to contruct a decorator using a client_secrets.json file described in the flow_from_secrets() section of the OAuth 2.0 page
  • 13. Using Decorators ●  Need to add a specific URL handler to your application to handle the redirection from the authorization server back to your application def main() application = webapp.WSGIApplication( [ ('/', MainHandler), ('/about', AboutHandler), (decorator.callback_path, decorator.callback_handler()), ], debug=True) run_wsgi_app(application)
  • 14. Sample Authentication Code In the following code snippet, the OAuth2Decorator class is used to create an oauth_required decorator, and the decorator is applied to a function that accesses the Google Calendar API decorator = OAuth2Decorator( client_id='your_client_id', client_secret='your_client_secret', scope='https://www.googleapis.com/auth/calendar') service = build('calendar', 'v3') class MainHandler(webapp.RequestHandler): @decorator.oauth_required def get(self): # Get the authorized Http object created by the decorator. http = decorator.http() ...
  • 15. How to get Client ID and Client Secret 1. Go to http://code.google.com/apis/console 2. Go to API Access - Click button “Create Another Client ID...” 3. Fill in information about the application
  • 16. Invoking Google Calendar API 1.  Go to https://code.google.com/apis/console and click Services and enable Calendar API 2.  Specify OAuth2 setting and service that we want to call decorator = OAuth2Decorator( client_id='194577071906tgj1to860hhjbnjio1mf7ij0pljh77kl.apps.googleusercontent.com', client_secret='y3gWfp6FIaqiusr7YYViKKPM', scope='https://www.googleapis.com/auth/calendar') service = build('calendar', 'v3') 1.  Suppose that we want to create Google calendar event ●  Need to look for request body at https://developers.google.com/google-apps/calendar/v3/ reference/events/insert
  • 17. Creating Google Calendar Event class MainPage(webapp2.RequestHandler): @decorator.oauth_required def get(self): http = decorator.http() event = { 'summary': 'Google App Engine Training', 'location': 'Thai-Nichi Institute of Technology', 'start': { 'dateTime': '2013-07-20T09:00:00.000+07:00' }, 'end': { 'dateTime': '2013-07-20T16:00:00.000+07:00' } } insert_event = service.events().insert(calendarId='primary', body=event).execute(http=http) self.response.write("Create event success with ID: " + insert_event['id'])
  • 18. The App Asking the User for Permission
  • 19. Result of Creating Calendar Event
  • 20. Using Google Cloud SQL ●  Google Cloud SQL is a web service that allows you to create, configure, and use relational databases that live in Google's cloud ●  By offering the capabilities of a familiar MySQL database, the service enables you to easily move your data, applications, and services in and out of the cloud ●  There is a range of configurations from small instances costing just $0.025 per hour up to high end instances with 16GB of RAM and 100GB of data storage.
  • 21. How to Create a Instance on Cloud SQL 1. Go to Google Cloud Console at http://cloud.google.com 2. Choose project that we want to use Cloud SQL 3. At the side menu, choose Cloud SQL 4. Then click button New Instance
  • 22. Accessing Cloud SQL (1 of 4) 1. Import library rdbms from google.appengine.api import rdbms 2. Set up instance name _INSTANCE_NAME = "virtual-airport-281:prinyaworkshop" 3. Connect to database conn = rdbms.connect(instance=_INSTANCE_NAME, database='Comment') cursor = conn.cursor() 4.Specify SQL command to use cursor.execute('SELECT comment, name FROM comment')
  • 23. Accessing Cloud SQL (2 of 4) 5. Using templates to display the data obtained from SQL result templates = { 'page_title' : 'Template Workshop', 'comment' : cursor.fetchall(), } {% for row in comment %} <tr> <td>{{ row[0] }}</td> <td>{{ row[1] }}</td> </tr> {% endfor %}
  • 24. Accessing Cloud SQL (3 of 4) If you find that there is the problem, “The rdbms API is not available because the MySQLdb library could not be loaded”, ●  Type import MySQLdb in file dev_appserver.py 6. You can use any other SQL commands such as INSERT or DELETE with the function cursor.execute() cursor.execute("INSERT INTO comment (comment,name) VALUES (%s,%s)", (comment, name)); conn.commit(); 7. After you finish with all tasks with cloud SQL, you should issue function close() conn.close();
  • 25. Sample Result ●  As the user type comment, and name and click button Insert data, the app will insert data into Cloud SQL, and then display the inserted data in the table on the page
  • 26. Conclusion ●  Google App Engine (GAE) will help developers to make it easy to build scalable applications ●  There are two favorite languages for implementing apps on GAE ○  Python and Java ●  To call Google API to access data, need to use OAuth 2.0 ●  To leverage existing relational databases, should use Cloud SQL
  • 28. Thank you • Kanda Runapongsa Saikaew •  Khon Kaen University, Thailand •  Assistant Professor of Department of Computer Engineering •  Associate Director for Administration, Computer Center •  [email protected] •  Twitter @krunapon •  https://plus.google.com/u/ 0/118244887738724224199