• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduccion app engine con python
 

Introduccion app engine con python

on

  • 2,177 views

Slides de la charla en GTUG Buenos Aires acerca de el Google App Engine con Python

Slides de la charla en GTUG Buenos Aires acerca de el Google App Engine con Python

Statistics

Views

Total Views
2,177
Views on SlideShare
2,177
Embed Views
0

Actions

Likes
0
Downloads
24
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

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

    Introduccion app engine con python Introduccion app engine con python Presentation Transcript

    • Sebastián Serrano [email_address] twitter: sserrano44 http://www.lp-gtug.org Google App Engine + Python en 5 minutos
    • Cloud Computing??
    • 0% Administracion = 100% Desarrollo
    • Google App Engine
        • Fácil de Desarrollar
        • Fácil de Mantener
        • Fácil de Escalar
    • Servicios del App Engine
    • Lenguajes
    • Empezar es GRATIS!
        • ~5M pageviews/month 
        • 6.5 CPU hrs/day 
        • 1 GB storage 
        • 650K URL Fetch calls/day 
        • 2,000 recipients emailed 
        • 1 GB/day bandwidth
        • 100,000 tasks enqueued 
        • 650K XMPP messages/day 
    • App Engine Dashboard
    • SDK Console
        • Descargar el SDK
          • http://code.google.com/appengine
        • Registrar una cuenta
          • https://appengine.google.com
        • Escribir código - deploy!
      Primeros pasos App Engine
    • Arrancar un proyecto $ dev_appserver.py helloworld # run dev svr $ appcfg.py update helloworld # deploy live Linux, MacOS, etc. command-line: Windows GUI (y Mac):
    • Contenido basico app.yaml – archivo configuración main principal index.yaml – generado automáticamente para indexar nuestros datos main.py – el código de la aplicación
    • main.py
    • Local development server $ dev_appserver.py helloworld INFO 2009-03-04 17:51:22,354 __init__.py]
    • Deploying the application
        • Set application identifier
        • Run deploy script
        • You're live!
    • Modifying app.yaml application:  helloworld version: 1 runtime: python api_version: 1 handlers: - url: .* script: main.py
    • Running the deploy script $ appcfg.py update helloworld Scanning files on local disk. Initiating update. Email: ...
    • You're live!
    • Demo time??
    • main.py: Skeleton application from google.appengine.ext import webapp from google.appengine.ext.webapp import util class MainHandler(webapp.RequestHandler):    def get(self):      self.response.out.write('Hello world!') def main():    application = webapp.WSGIApplication([('/', MainHandler)],                                        debug=True)    util.run_wsgi_app(application) if __name__ == '__main__':    main()
    • main.py: Adding a handler from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app class MainHandler(webapp.RequestHandler):      def get(self):          self.response.out.write('<h1>Hello world!</h1>')          self.response.out.write('''              <form action=&quot;/sign&quot; method=post>              <input type=text name=content>              <br><input type=submit value=&quot;Sign Guestbook&quot;>              </form>          ''') class GuestBook(webapp.RequestHandler):      def post(self):          self.response.out.write(              '<h2>You wrote:</h2> %s' % self.request.get('content')          ) application = webapp.WSGIApplication([      ('/', MainHandler),      ('/sign', GuestBook), ], debug=True) # start_wsgi_app etc ... 
    • main.py: Persisting to the datastore class GuestBook(webapp.RequestHandler):      def post(self):          greeting = Greeting()          greeting.content = self.request.get('content')          greeting.put()          self.redirect('/')
    • main.py: Collecting values from the datastore class MainHandler(webapp.RequestHandler):      def get(self):          self.response.out.write('Hello world!')          self.response.out.write('<h1>My GuestBook</h1><ol>')          greetings = Greeting.all()          for greeting in greetings:              self.response.out.write('<li> %s' % greeting.content)          self.response.out.write('''              </ol><hr>              <form action=&quot;/sign&quot; method=post>              <textarea name=content rows=3 cols=60></textarea>              <br><input type=submit value=&quot;Sign Guestbook&quot;>              </form>          ''')
    • Live demo??
    • Gracias!
      • email: sebastian@devsar.com
      • twitter: sserrano44