An Introduction to GAEO web framework
Upcoming SlideShare
Loading in...5
×
 

An Introduction to GAEO web framework

on

  • 3,704 views

The GAEO talk in OSDC.tw 2009

The GAEO talk in OSDC.tw 2009

Statistics

Views

Total Views
3,704
Views on SlideShare
3,103
Embed Views
601

Actions

Likes
0
Downloads
45
Comments
0

36 Embeds 601

http://allisterx.blogspot.com 326
http://allisterx.blogspot.in 28
http://allisterx.blogspot.com.br 28
http://allisterx.blogspot.com.es 26
http://infuture.pixnet.net 23
http://allisterx.blogspot.de 22
http://allisterx.blogspot.ca 21
http://allisterx.blogspot.co.uk 21
http://allisterx.blogspot.pt 13
http://allisterx.blogspot.it 12
http://allisterx.blogspot.fr 10
http://allisterx.blogspot.ru 6
http://www.slideshare.net 6
http://allisterx.blogspot.jp 5
http://allisterx.blogspot.ro 5
http://allisterx.blogspot.nl 4
http://allisterx.blogspot.no 3
http://allisterx.blogspot.cz 3
http://allisterx.blogspot.dk 3
http://allisterx.blogspot.gr 3
http://allisterx.blogspot.co.il 3
http://allisterx.blogspot.mx 3
http://allisterx.blogspot.com.au 3
http://translate.googleusercontent.com 3
http://allisterx.blogspot.se 3
http://allisterx.blogspot.sk 2
http://allisterx.blogspot.fi 2
http://allisterx.blogspot.hu 2
http://allisterx.blogspot.co.nz 2
http://allisterx.blogspot.tw 2
http://allisterx.blogspot.com.ar 2
http://allisterx.blogspot.ch 2
http://allisterx.blogspot.be 1
http://allisterx.blogspot.hk 1
http://allisterx.blogspot.co.at 1
http://www.allisterx.blogspot.com.br 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

An Introduction to GAEO web framework An Introduction to GAEO web framework Presentation Transcript

  • An Introduction to GAEO web framework ericsk OSDC.tw 2009
  • Agenda Google App Engine Why GAEO? How to use GAEO Roadmap Live Demo
  • Google App Engine Host your web application and data (w/ quota limits) You don't need to maintain the server, focus on your application Pay for what you use. (no setup fee) Scalable servers and storages Google's infrastructure Cron service (NEW ) Both Python and Java (NEW ) are supported
  • Google App Engine (cont.) Dashboard
  • Why GAEO? I need a web framework. webapp is too simple; django is too complicated. GAEO: Google App Engine Oil Convension over configuration. More easily development on GAE to Rails/Zend Framework developers.
  • What is GAEO? Model-Template-Controller -based web framework. based on webapp inspired from Rails/Zend Framework Implemented in *pure* Python More libraries for request/response processing. easy and powerful URL routing convention session support easy and quick for different output types easy object-relation-model controller and model's hook
  • GAEO's Architecture action action dispatcher client . request dispatch . . action response
  • Code Layout (GAEO-0.3) $APP_BASE/ application/ controllers/ models/ templates/ assets/ css/ img/ js/ gaeo/ libs/ plugins/ app.yaml favicon.ico main.py
  • GAEO URL Routing Default: http://example.com/foo/bar/1234 controller: foo (FooController class)action: bar (bar method in FooController)id: 1234 Configurable & Parameterize: route.connect('/signin', controller='account', action='signin') route.connect('/user/:name', controller='user', action='show') route.connect('/foo/:action/:x/:y/:z', controller='foo')
  • GAEO 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
  • GAEO Action Controller (cont.) Use render method to output different response data. (helps set the Content-Type header) Use redirect method to redirect to another action (or URL) Hook action in before_action and after_action function Mobile device detection. (_is_mobile, _is_iphone, _is_android) Session object.
  • GAEO Action Controller (cont.) Sample controller: from gaeo.controller import BaseController class FooController(BaseController): def bar(self): name = self.params.get('name', 'anonymous') self.render(html='<h1>Hello, %s' % name) def update(self): if self._request_method == 'post': // update some model self.redirect('/foo/edit') else: self.render(text=quot;Invalid Requestquot;)
  • GAEO Model Extends GAE's Model class. Add one-to-many and many-to-many helper Update properties within single method -- update_attributes Add before_put and after_put hook.
  • GAEO Model (cont.) model sample: from gaeo.model import BaseModel class User(BaseModel): name = db.StringProperty() email = db.EmailProperty() created = db.DateTimeProperty(auto_now_add=True) def before_put(self): // TODO: check property values if failed: return False
  • How to Use GAEO
  • Installation Download the release archive, and unpack it. Install it through easy_install Setup the $PATH for using GAEO's utilities.
  • GAEO Utilities gaeo.py - Create a GAEO project. gaeogen.py - Generate a GAEO a controller, model, or plugin.
  • Live Demo
  • GAEO's Roadmap XML-RPC support Caching i18n support RESTful Extend the Template engine CMS ...
  • GAEO Resources Project home: http://code.google.com/p/google-app-engine-oil/ Document site: http://doc.gaeo.org/, http://doc-zhtw.gaeo.org/, http://doc-fr. gaeo.org/, http://doc-ja.gaeo.org/ Groups: http://groups.google.com/group/google-app-engine-oil IRC: #gaeo on irc.freenode.net
  • Q&A 感謝您的收聽 Thanks for you attendance ご清聴とうもありがとうございました