Mi Primera Aplicacion en Google App Engine

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Mi Primera Aplicacion en Google App Engine - Presentation Transcript

    1. Mi Primera Aplicacion usando Google App Engine Adrian Catalan
    2. Y que es eso del GAE?  Google App Engine es una plataforma de desarrollo  Python & Java  Cloud Computing  Todo como un servicio I have not heard two people say the same thing about it [cloud]. There  are multiple definitions out there of “the cloud” Andy Isherwood, HP’s Vice President of European Software Sales
    3. Google App Engine  Tenemos por seguro que hace una cosa bien: correr  aplicaciones web  Y ademas...  Simple  Escalable  Seguro  Balanceo de carga
    4. Google App Engine  Datastore  Big Table y GQL  Frameworks  Django (hell yeah...!)  CherryPy  Webapp  WSGI  Servicios (google accounts, mail, url fetch & mas)
    5. App Engine Architecture req/resp stateless APIs R/O FS urlfech Python stdlib VM mail process app images stateful datastore APIs memcache 5
    6. Por que voy a dejar de usar LAMP?  Pareciera ser EL estandar  ...pero  Configuracion  Tuning  Problemas con el Hardware  Updates  Y mas
    7. Datastore  Las Entidades tienen Kind, Key, y Propiedades  Entity ~~ Record ~~ Python dict ~~ Python class  instance  Key ~~ structured foreign key; includes Kind  Kind ~~ Table ~~ Python class  Property ~~ Column or Field; has a type
    8. Desventajas  Ambiente muy controlado  Solo Python y Java por el momento  Facil de usar  ...pero limitado (gratis)  Si los frameworks estan atados a bd relacionales, de  que forma pasaran a ser parte de GAE?
    9. Cuando usar GAE  Queremos tenerlo funcionando ASAP  Empezando un proyecto nuevo  Conocemos Python  Las limitaciones no son un problema para nosotros  No estamos en un proyecto muy grande con cosas  dificiles de implementar
    10. Google App Engine  Hacia donde vamos?
    11. Google App Engine  Y ahora...vamos al demo
    12. Como empezamos?  Descargamos el SDK (duh!)  dev_appserver.py  appcfg.py  Hola, mundo...desde la nube! print 'Content­Type: text/plain' print ' ' print 'Hello, world!'
    13. Y la configuracion? (app.yaml) application: helloworld version: 1 runtime: python api_version: 1 handlers: ­ url: /.*   script: helloworld.py
    14. Empezando a usar webapp from google.appengine.ext import webapp from google.appengine.ext.webapp.util import  run_wsgi_app class MainPage(webapp.RequestHandler):   def get(self):     self.response.headers['Content­Type'] =  'text/plain'     self.response.out.write('Hello, webapp World!')
    15. Empezando a usar webapp application = webapp.WSGIApplication(                                      [('/', MainPage)],                                      debug=True) def main():   run_wsgi_app(application) if __name__ == "__main__":   main()
    16. Usando el servicio de usuarios  users.get_current_user()  create_login_url(dest_url)  get_current_user()
    17. ElModelo class BlogEntry(db.Model):   author = db.UserProperty()   title = db.StringProperty()   content = db.StringProperty(multiline=True)   date=db.DateTimeProperty(auto_now_add=True)
    18. El resto de ElModelo class BlogComment (db.Model):   author = db.UserProperty()   content = db.StringProperty(multiline=True)   date=db.DateTimeProperty(auto_now_add=True)   entry =  db.ReferenceProperty(BlogEntry,collection_name ='cm')
    19. Agregando al Datastore class Entry (webapp.RequestHandler):   def post(self):     en = BlogEntry()     en.author = users.get_current_user()     en.content = self.request.get('content')     en.title = self.request.get('title')     en.put()     self.redirect('/')
    20. Templates de Django class MainPage(webapp.RequestHandler):   def get(self):     query = BlogEntry.all().order('­date')     entries = query.fetch(3)     template_values = {       'entries': entries,      }     path = os.path.join(os.path.dirname(__file__), 'index.html')     self.response.out.write(template.render(path,  template_values))
    21. Templates de Django {% for entry in entries %}       <a href="/show? key={{ entry.key }}"><b>{{ entry.title }}</b></a>       <blockquote>{{ entry.content| escape }}</blockquote>       <small>Publicado por  <b>{{ entry.author.nickname }}</b></small>       <hr/>     {% endfor %}
    22. Indicando rutas application = webapp.WSGIApplication(                                      [('/', MainPage),                                       ('/comment', Comment),                                       ('/entry', Entry),                                       ('/show', ShowEntry),                                       ('/publish', PublishEntry)],                                      debug=True)
    23.  El codigo lo encuentran en http://www.megaupload.com/?d=0XUF9QIG Preguntas || kthxbye
    SlideShare Zeitgeist 2009

    + ykroykro Nominate

    custom

    795 views, 0 favs, 0 embeds more stats

    Presentacion para el segundo Barcamp en Guatemala s more

    More info about this document

    CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

    Go to text version

    • Total Views 795
      • 795 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 7
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories