2. Outline
Google App Engine overview
Why we develop the GAEO framework
What's done in GAEO 0.1
GAEO's current & future features
How to start using GAEO (DEMO)
GAEO links
Q&A
3. Current Google App Engine
An application server with pure Python runtime
language
also a web server for you
(HTTP) Request-based environment
Uses BigTable as database
Application version control and seamless
upgrades/degrades.
HTTPS support (*.appspot.com only)
6. Handle HTTP Request
class IndexView(webapp.RequestHandler):
def get(self):
# get the user object
user = users.get_current_user()
if user: # the user has logined
self.redirect('/home')
template_values = {
'signin_url': users.create_login_url('/home'),
}
9. Goal
To be familiar with AppEngine
Convention over configuration
Structured, meaningful, parameterized URL
More helper methods
Quickly migrate from ZF or Rails
For team works
14. Action Controller
Each request is distributed to an action
In GAEO, an action is a method of an action controller
Create a controller class that extends gaeo.controller.
BaseController
Implement the action
class FooController(BaseController):
def bar(self):
quot;quot;quot;
TODO: do things for /foo/bar request
quot;quot;quot;
pass
15. Response Helper
Use to_json method (uses simplejson) to convert a dict
instance to a JSON string
Use render method to output different response data. (helps set
the Content-Type header)
Use redirect method to redirect to another action (or URL)
Do something in before_action and after_action filters
16. Session support
Store data at server (mapping clients via Session-IDs that stores
in cookies)
GAEO has designed a session interface and a memcache-
session implementation.
Use self.session in the actions.
17. Model enhancement
Add some helper methods
update_attributes
save, update
Naming query
A beginning of ORM
belongs_to method
18. Other helpers
Object shortcuts:
request
response
cookies
Mobile device detection
_is_iphone
_is_mobile
20. Setuptools support
Now you can use easy_install gaeo to install the GAEO
package.
Also available on pypi http://pypi.python.org/pypi/gaeo
Provided by gasolin
21. Scaffold
Quickly generates some common pages
new
list
show
edit
create
update
destroy
Provided by xeonchen
23. Other Enhancements
Global initialization
application_init method (in ApplicationController)
AJAX/Form helpers
generates some useful AJAX/form strings
The respond_to method
respond content according to :format parameter
zip core import
You can zip the GAEO core to eliminate disk space cost
methods enhancements