Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Make your Pony fly with Google App Engine

Make your Pony fly with Google App Engine

Why and how could be useful developing web services with Django and deploying them on Google App Engine

Massimiliano Pippi

November 16, 2013
Tweet

More Decks by Massimiliano Pippi

Other Decks in Programming

Transcript

  1. • easy to learn, simple to use • clean syntax

    • huge range of libraries • rapid prototyping • vast documentation • friendly community • named after Monty Python Why Python?
  2. • easy to learn, simple to use • automatic scaling

    • deploy and forget Why App Engine?
  3. Why Django? • easy to learn, simple to use •

    full stack • modular (almost) • named after Django Reinhardt
  4. What can a pony do for you? Some sweeties for

    mobile developers • data backends exposing REST api • backoffice systems and CRUDs • servers talking to cloud messaging services
  5. The pony into the wild Build a REST web service

    in minutes • design the business model • provide a REST api • authenticate users with the OAuth2 framework
  6. Toodo app Track a list of tasks with a description

    and a flag to mark them as done The Model
  7. The API URL style HTTP Method Action URL Name /

    GET show API infos api-root /tasks/[.format] GET list tasks tasks-list POST create a new task /tasks/{id}/[.format] GET retrieve task tasks-detail PUT update task PATCH partially update task DELETE destroy task Data serialized in dozen of formats out of the box: JSON, JSONP, XML, Yaml and others, plus you can write your very own. Bonus: api browser
  8. Django OAuth Toolkit (third party application providing oauth goodies) Let’s

    do OAuth2 (seriously, that’s all folks!) Now the system acts as an OAuth2 provider and the api endpoints grant access to clients providing valid tokens
  9. Well, not quite. There are a lot of pros running

    Django on App Engine • one-click deploy, app versioning • scale as you want • Google infrastructure But some of the cons could be blocking • Google Cloud SQL is the only backend supported by the Django ORM • Google Cloud SQL has no free tiers (at the moment) • Google Cloud SQL is MySql
  10. Thanks for your attention! Questions? (in the meantime, take a

    look at the code) https://github.com/masci/toodo http://django-rest-framework.org https://github.com/evonove/django-oauth-toolkit Massimiliano Pippi @maxpippi http://github.com/masci http://dev.pippi.im