SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
Deploying a Pylons app
to Google App Engine
    Boston Python meetup - 6/18/08

             Nate Aune
          www.jazkarta.com
          www.nateaune.com




                                     1
Disclaimer #1
quot;I just started using Pylons last week.quot;




                                           2
Disclaimer #2
quot;I just started using Google App Engine last week.quot;




                                                      3
App: Gigblastr

• Goal: make it easier to promote an event
 • Fill out a form with event details
 • Blast event to dozens of event listing sites
• Similar to TubeMogul but for events instead
  of videos.



                                                  4
Tubemogul.com




                5
Musician




                             Add event



     Title    Poludaktulos Orchestra

Description   The Poludaktulos Orchestra (the quot;Many-
              Fingered Orchestraquot;) employs unique
              instrumentation in its lively performances of
              northern Greek brass band music.


     URL      http://myspace.com/poludaktulosorchestra

    Venue     Johnny D's

     Date     11/8/08

Start Time    9:00pm                      End   11:00pm




                              Blast it!




                                                              6
Brief history
  Implemented using content rules for Plone
• version 0.1 @ DevHouseBoston3 2007
   • posting to Twitter and Eventful
• version 0.2 @ Home
   • posting to Upcoming.org
• version 0.3 @ DevHouseBoston4 2008
   • rewrite as Pylons app deployed to GAE
                                              7
Bootstrap with the
            appenginemonkey
$ svn co http://appengine-monkey.googlecode.com/svn/trunk ape-monkey
$ cd ape-monkey
$ python2.5 appengine-boot.py --paste-deploy ~/gae/gigblastr
$ cd ~/gae/gigblastr
$ source bin/activate
(gigblastr)$ easy_install Mako==dev Pylons==dev Paste
...
(gigblastr)$ cd src
(gigblastr)$ paster create --template=pylons GigBlastr
(gigblastr)$ cd GigBlastr
(gigblastr)$ python setup.py develop
(gigblastr)$ python -m pth_relpath_fixup




                                                                       8
Configure your
                environment
      • Edit development.ini
[app:the-app]
use = config:src/GigBlastr/development.ini




     • Launch the application
$ /usr/bin/python2.5 /usr/local/google_appengine/dev_appserver.py 
   ~/gae/gigblastr/



     • Visit http://localhost:8080/
                                                                      9
Edit the routes
     • In GigBlastr/config/routing.py
map.connect('', controller='hello', action='index')



    • Create a 'hello' controller
$ paster controller hello


    • Restart and visit
       http://localhost:8080/hello/index

                                                      10
Hello World
import logging

from pylons import request, response, session
from pylons import tmpl_context as c
from pylons.controllers.util import abort, redirect_to

from gigblaster.lib.base import BaseController, render
#import gigblaster.model as model

log = logging.getLogger(__name__)

class HelloController(BaseController):

    def index(self):
        # Return a rendered template
        #   return render('/template.mako')
        # or, Return a response
        return 'Hello World'



                                                         11
Twitter
(gigblastr)$ easy_install python_twitter



 • In GigBlastr/controller/hello.py
  import twitter

   def tweet(self):
        api = twitter.Api(username='natea',
                          password='xxxxxxx')

        status = api.PostUpdate('testing tweets from GAE')
        return status.text



• Restart and visit
   http://localhost:8080/hello/tweet/index

                                                             12
Eventful
   (gigblastr)$ easy_install eventful



     • In GigBlastr/controller/hello.py
import eventful

def evtful(self):
    api = eventful.API('xxxxxxxxxxxxx')

    events = api.call('/events/search', q='music', l='Cambridge, MA')
    for event in events['events']['event']:
        print quot;%s at %squot; % (event['title'], event['venue_name'])



    • Restart and visit
       http://localhost:8080/hello/evtful/index
                                                                  13
Upload app to GAE

$ cd gigblastr
$ /usr/bin/python2.5 /usr/local/google_appengine/appcfg.py update .



       • 973 files - whew!
       • If your app has more than 1000 files, you'll
          have to remove some unused eggs.




                                                                      14
Remove _speedups
    import simplejson
  File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/
simplejson/__init__.pyquot;, line 113, in <module>
    from encoder import JSONEncoder
  File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/
simplejson/encoder.pyquot;, line 6, in <module>
    from simplejson import _speedups
  File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/
simplejson/_speedups.pyquot;, line 7, in <module>
    __bootstrap__()
  File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/
simplejson/_speedups.pyquot;, line 5, in __bootstrap__
    del __bootstrap__, __loader__
NameError: global name '__loader__' is not defined




              • Remove _speedups.py and _speedups.so
                   from simplejson
              • They are trying to cache on the file
                   system, which is a no-no on GAE.

                                                                                                                      15
Guido, the creator of
  Python speaks!




                        16
ianbicking to the
     rescue!  Ian responds one
                 week later




                                 17
Use httplib on GAE
 • In paste-deploy.py:
## If you want to use httplib but get socket errors,
## you should uncomment this line:
appengine_monkey.install_httplib()




                                                       18
No Twitter from GAE
         :(




                      19
More info
• Google App Engine
  http://code.google.com/appengine/


• Pylons
  http://pylonshq.com


• Instructions for Pylons on GAE
  http://code.google.com/p/appengine-monkey/wiki/Pylons


• DevHouseBoston
  http://devhouseboston.org




                                                          20
Thanks!

• To Ian Bicking for making appengine-
  monkey, making the instructions, and
  helping on IRC.
• The kind folks in #pylons who helped me
  get my head around Pylons syntax




                                            21

Más contenido relacionado

La actualidad más candente

Docker and plone
Docker and ploneDocker and plone
Docker and ploneAlin Voinea
 
MeCab in docker action(OpenWhisk)
MeCab in docker action(OpenWhisk)MeCab in docker action(OpenWhisk)
MeCab in docker action(OpenWhisk)KUNITO Atsunori
 
Vagrant up-and-running
Vagrant up-and-runningVagrant up-and-running
Vagrant up-and-runningJoe Ferguson
 
Installation and setup hadoop published
Installation and setup hadoop publishedInstallation and setup hadoop published
Installation and setup hadoop publishedDipendra Kusi
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChang W. Doh
 
Volunteering atyouseeforit services
Volunteering atyouseeforit servicesVolunteering atyouseeforit services
Volunteering atyouseeforit servicesYouSee
 
A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.Subramanyam Vemala
 
Membuat virtual environment python
Membuat virtual environment pythonMembuat virtual environment python
Membuat virtual environment pythonJunifar hidayat
 
Managing your Drupal project with Composer
Managing your Drupal project with ComposerManaging your Drupal project with Composer
Managing your Drupal project with ComposerMatt Glaman
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Managing Complexity with Module::Release
Managing Complexity with Module::ReleaseManaging Complexity with Module::Release
Managing Complexity with Module::Releasebrian d foy
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii ShumadaFwdays
 
Introduction to PhoneGap and PhoneGap Build
Introduction to PhoneGap and PhoneGap BuildIntroduction to PhoneGap and PhoneGap Build
Introduction to PhoneGap and PhoneGap BuildMartin de Keijzer
 
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...HighSolutions Sp. z o.o.
 
Last Month in PHP - April 2016
Last Month in PHP - April 2016Last Month in PHP - April 2016
Last Month in PHP - April 2016Eric Poe
 
Java Stammtisch Würzburg - CONAIR
Java Stammtisch Würzburg - CONAIRJava Stammtisch Würzburg - CONAIR
Java Stammtisch Würzburg - CONAIRMatthias Reining
 
Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12Curtiss Grymala
 
MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)brian d foy
 

La actualidad más candente (20)

Docker and plone
Docker and ploneDocker and plone
Docker and plone
 
MeCab in docker action(OpenWhisk)
MeCab in docker action(OpenWhisk)MeCab in docker action(OpenWhisk)
MeCab in docker action(OpenWhisk)
 
Vagrant up-and-running
Vagrant up-and-runningVagrant up-and-running
Vagrant up-and-running
 
Installation and setup hadoop published
Installation and setup hadoop publishedInstallation and setup hadoop published
Installation and setup hadoop published
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Volunteering atyouseeforit services
Volunteering atyouseeforit servicesVolunteering atyouseeforit services
Volunteering atyouseeforit services
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
 
Webpack DevTalk
Webpack DevTalkWebpack DevTalk
Webpack DevTalk
 
A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.A Java Microservices Spring Boot and Docker case study.
A Java Microservices Spring Boot and Docker case study.
 
Membuat virtual environment python
Membuat virtual environment pythonMembuat virtual environment python
Membuat virtual environment python
 
Managing your Drupal project with Composer
Managing your Drupal project with ComposerManaging your Drupal project with Composer
Managing your Drupal project with Composer
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Managing Complexity with Module::Release
Managing Complexity with Module::ReleaseManaging Complexity with Module::Release
Managing Complexity with Module::Release
 
"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada"13 ways to run web applications on the Internet" Andrii Shumada
"13 ways to run web applications on the Internet" Andrii Shumada
 
Introduction to PhoneGap and PhoneGap Build
Introduction to PhoneGap and PhoneGap BuildIntroduction to PhoneGap and PhoneGap Build
Introduction to PhoneGap and PhoneGap Build
 
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 
Last Month in PHP - April 2016
Last Month in PHP - April 2016Last Month in PHP - April 2016
Last Month in PHP - April 2016
 
Java Stammtisch Würzburg - CONAIR
Java Stammtisch Würzburg - CONAIRJava Stammtisch Würzburg - CONAIR
Java Stammtisch Würzburg - CONAIR
 
Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12Writing a WordPress Plugin: #heweb12
Writing a WordPress Plugin: #heweb12
 
MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)MyCPAN (Frozen Perl 2008 Lightning Talk)
MyCPAN (Frozen Perl 2008 Lightning Talk)
 

Similar a Deploying a Pylons app to Google App Engine

Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as codeJulian Simpson
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Deploying phalcon on heroku
Deploying phalcon on herokuDeploying phalcon on heroku
Deploying phalcon on herokuTung Ns
 
HotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushEvan Schultz
 
Django & Buildout (en)
Django & Buildout (en)Django & Buildout (en)
Django & Buildout (en)zerok
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data scienceCalvin Giles
 
Let's break apache spark workshop
Let's break apache spark workshopLet's break apache spark workshop
Let's break apache spark workshopGrzegorz Gawron
 
Odoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvOdoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvacsone
 
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24Kei IWASAKI
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Yuriy Senko
 
How to host an app for $20 in 20min using buildout and hostout
How to host an app  for $20 in 20min using buildout and hostoutHow to host an app  for $20 in 20min using buildout and hostout
How to host an app for $20 in 20min using buildout and hostoutDylan Jay
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerGraham Charters
 
Buildout: Fostering Repeatability
Buildout: Fostering RepeatabilityBuildout: Fostering Repeatability
Buildout: Fostering RepeatabilityClayton Parker
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using DjangoSunil kumar Mohanty
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & NotebookAreski Belaid
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIBruno Rocha
 
I/O Extended 2019 WebTech - New capabilities for the web
I/O Extended 2019 WebTech - New capabilities for the webI/O Extended 2019 WebTech - New capabilities for the web
I/O Extended 2019 WebTech - New capabilities for the webHanboramRobinJang
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacriptLei Kang
 

Similar a Deploying a Pylons app to Google App Engine (20)

Adventures in infrastructure as code
Adventures in infrastructure as codeAdventures in infrastructure as code
Adventures in infrastructure as code
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Deploying phalcon on heroku
Deploying phalcon on herokuDeploying phalcon on heroku
Deploying phalcon on heroku
 
HotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePushHotPush with Ionic 2 and CodePush
HotPush with Ionic 2 and CodePush
 
Django & Buildout (en)
Django & Buildout (en)Django & Buildout (en)
Django & Buildout (en)
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
Let's break apache spark workshop
Let's break apache spark workshopLet's break apache spark workshop
Let's break apache spark workshop
 
Odoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenvOdoo development workflow with pip and virtualenv
Odoo development workflow with pip and virtualenv
 
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
How to host an app for $20 in 20min using buildout and hostout
How to host an app  for $20 in 20min using buildout and hostoutHow to host an app  for $20 in 20min using buildout and hostout
How to host an app for $20 in 20min using buildout and hostout
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for Docker
 
Buildout: Fostering Repeatability
Buildout: Fostering RepeatabilityBuildout: Fostering Repeatability
Buildout: Fostering Repeatability
 
Virtual Environment and Web development using Django
Virtual Environment and Web development using DjangoVirtual Environment and Web development using Django
Virtual Environment and Web development using Django
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CI
 
I/O Extended 2019 WebTech - New capabilities for the web
I/O Extended 2019 WebTech - New capabilities for the webI/O Extended 2019 WebTech - New capabilities for the web
I/O Extended 2019 WebTech - New capabilities for the web
 
Testing of javacript
Testing of javacriptTesting of javacript
Testing of javacript
 

Más de Jazkarta, Inc.

Traveling through time and place with Plone
Traveling through time and place with PloneTraveling through time and place with Plone
Traveling through time and place with PloneJazkarta, Inc.
 
Questions: A Form Library for Python with SurveyJS Frontend
Questions: A Form Library for Python with SurveyJS FrontendQuestions: A Form Library for Python with SurveyJS Frontend
Questions: A Form Library for Python with SurveyJS FrontendJazkarta, Inc.
 
The User Experience: Editing Composite Pages in Plone 6 and Beyond
The User Experience: Editing Composite Pages in Plone 6 and BeyondThe User Experience: Editing Composite Pages in Plone 6 and Beyond
The User Experience: Editing Composite Pages in Plone 6 and BeyondJazkarta, Inc.
 
WTA and Plone After 13 Years
WTA and Plone After 13 YearsWTA and Plone After 13 Years
WTA and Plone After 13 YearsJazkarta, Inc.
 
Collaborating With Orchid Data
Collaborating With Orchid DataCollaborating With Orchid Data
Collaborating With Orchid DataJazkarta, Inc.
 
Spend a Week Hacking in Sorrento!
Spend a Week Hacking in Sorrento!Spend a Week Hacking in Sorrento!
Spend a Week Hacking in Sorrento!Jazkarta, Inc.
 
Plone 5 Upgrades In Real Life
Plone 5 Upgrades In Real LifePlone 5 Upgrades In Real Life
Plone 5 Upgrades In Real LifeJazkarta, Inc.
 
Accessibility in Plone: The Good, the Bad, and the Ugly
Accessibility in Plone: The Good, the Bad, and the UglyAccessibility in Plone: The Good, the Bad, and the Ugly
Accessibility in Plone: The Good, the Bad, and the UglyJazkarta, Inc.
 
Getting Paid Without GetPaid
Getting Paid Without GetPaidGetting Paid Without GetPaid
Getting Paid Without GetPaidJazkarta, Inc.
 
An Open Source Platform for Social Science Research
An Open Source Platform for Social Science ResearchAn Open Source Platform for Social Science Research
An Open Source Platform for Social Science ResearchJazkarta, Inc.
 
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...Jazkarta, Inc.
 
Anatomy of a Large Website Project
Anatomy of a Large Website ProjectAnatomy of a Large Website Project
Anatomy of a Large Website ProjectJazkarta, Inc.
 
Anatomy of a Large Website Project - With Presenter Notes
Anatomy of a Large Website Project - With Presenter NotesAnatomy of a Large Website Project - With Presenter Notes
Anatomy of a Large Website Project - With Presenter NotesJazkarta, Inc.
 
The Mountaineers: Scaling the Heights with Plone
The Mountaineers: Scaling the Heights with PloneThe Mountaineers: Scaling the Heights with Plone
The Mountaineers: Scaling the Heights with PloneJazkarta, Inc.
 
Plone Hosting: A Panel Discussion
Plone Hosting: A Panel DiscussionPlone Hosting: A Panel Discussion
Plone Hosting: A Panel DiscussionJazkarta, Inc.
 
Academic Websites in Plone
Academic Websites in PloneAcademic Websites in Plone
Academic Websites in PloneJazkarta, Inc.
 
Online Exhibits in Plone
Online Exhibits in PloneOnline Exhibits in Plone
Online Exhibits in PloneJazkarta, Inc.
 
Online exhibits in Plone
Online exhibits in PloneOnline exhibits in Plone
Online exhibits in PloneJazkarta, Inc.
 

Más de Jazkarta, Inc. (20)

Traveling through time and place with Plone
Traveling through time and place with PloneTraveling through time and place with Plone
Traveling through time and place with Plone
 
Questions: A Form Library for Python with SurveyJS Frontend
Questions: A Form Library for Python with SurveyJS FrontendQuestions: A Form Library for Python with SurveyJS Frontend
Questions: A Form Library for Python with SurveyJS Frontend
 
The User Experience: Editing Composite Pages in Plone 6 and Beyond
The User Experience: Editing Composite Pages in Plone 6 and BeyondThe User Experience: Editing Composite Pages in Plone 6 and Beyond
The User Experience: Editing Composite Pages in Plone 6 and Beyond
 
WTA and Plone After 13 Years
WTA and Plone After 13 YearsWTA and Plone After 13 Years
WTA and Plone After 13 Years
 
Collaborating With Orchid Data
Collaborating With Orchid DataCollaborating With Orchid Data
Collaborating With Orchid Data
 
Spend a Week Hacking in Sorrento!
Spend a Week Hacking in Sorrento!Spend a Week Hacking in Sorrento!
Spend a Week Hacking in Sorrento!
 
Plone 5 Upgrades In Real Life
Plone 5 Upgrades In Real LifePlone 5 Upgrades In Real Life
Plone 5 Upgrades In Real Life
 
Accessibility in Plone: The Good, the Bad, and the Ugly
Accessibility in Plone: The Good, the Bad, and the UglyAccessibility in Plone: The Good, the Bad, and the Ugly
Accessibility in Plone: The Good, the Bad, and the Ugly
 
Getting Paid Without GetPaid
Getting Paid Without GetPaidGetting Paid Without GetPaid
Getting Paid Without GetPaid
 
An Open Source Platform for Social Science Research
An Open Source Platform for Social Science ResearchAn Open Source Platform for Social Science Research
An Open Source Platform for Social Science Research
 
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
For the Love of Volunteers! How Do You Choose the Right Technology to Manage ...
 
Anatomy of a Large Website Project
Anatomy of a Large Website ProjectAnatomy of a Large Website Project
Anatomy of a Large Website Project
 
Anatomy of a Large Website Project - With Presenter Notes
Anatomy of a Large Website Project - With Presenter NotesAnatomy of a Large Website Project - With Presenter Notes
Anatomy of a Large Website Project - With Presenter Notes
 
The Mountaineers: Scaling the Heights with Plone
The Mountaineers: Scaling the Heights with PloneThe Mountaineers: Scaling the Heights with Plone
The Mountaineers: Scaling the Heights with Plone
 
Plone Hosting: A Panel Discussion
Plone Hosting: A Panel DiscussionPlone Hosting: A Panel Discussion
Plone Hosting: A Panel Discussion
 
Plone+Salesforce
Plone+SalesforcePlone+Salesforce
Plone+Salesforce
 
Academic Websites in Plone
Academic Websites in PloneAcademic Websites in Plone
Academic Websites in Plone
 
Plone
PlonePlone
Plone
 
Online Exhibits in Plone
Online Exhibits in PloneOnline Exhibits in Plone
Online Exhibits in Plone
 
Online exhibits in Plone
Online exhibits in PloneOnline exhibits in Plone
Online exhibits in Plone
 

Último

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Último (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Deploying a Pylons app to Google App Engine

  • 1. Deploying a Pylons app to Google App Engine Boston Python meetup - 6/18/08 Nate Aune www.jazkarta.com www.nateaune.com 1
  • 2. Disclaimer #1 quot;I just started using Pylons last week.quot; 2
  • 3. Disclaimer #2 quot;I just started using Google App Engine last week.quot; 3
  • 4. App: Gigblastr • Goal: make it easier to promote an event • Fill out a form with event details • Blast event to dozens of event listing sites • Similar to TubeMogul but for events instead of videos. 4
  • 6. Musician Add event Title Poludaktulos Orchestra Description The Poludaktulos Orchestra (the quot;Many- Fingered Orchestraquot;) employs unique instrumentation in its lively performances of northern Greek brass band music. URL http://myspace.com/poludaktulosorchestra Venue Johnny D's Date 11/8/08 Start Time 9:00pm End 11:00pm Blast it! 6
  • 7. Brief history Implemented using content rules for Plone • version 0.1 @ DevHouseBoston3 2007 • posting to Twitter and Eventful • version 0.2 @ Home • posting to Upcoming.org • version 0.3 @ DevHouseBoston4 2008 • rewrite as Pylons app deployed to GAE 7
  • 8. Bootstrap with the appenginemonkey $ svn co http://appengine-monkey.googlecode.com/svn/trunk ape-monkey $ cd ape-monkey $ python2.5 appengine-boot.py --paste-deploy ~/gae/gigblastr $ cd ~/gae/gigblastr $ source bin/activate (gigblastr)$ easy_install Mako==dev Pylons==dev Paste ... (gigblastr)$ cd src (gigblastr)$ paster create --template=pylons GigBlastr (gigblastr)$ cd GigBlastr (gigblastr)$ python setup.py develop (gigblastr)$ python -m pth_relpath_fixup 8
  • 9. Configure your environment • Edit development.ini [app:the-app] use = config:src/GigBlastr/development.ini • Launch the application $ /usr/bin/python2.5 /usr/local/google_appengine/dev_appserver.py ~/gae/gigblastr/ • Visit http://localhost:8080/ 9
  • 10. Edit the routes • In GigBlastr/config/routing.py map.connect('', controller='hello', action='index') • Create a 'hello' controller $ paster controller hello • Restart and visit http://localhost:8080/hello/index 10
  • 11. Hello World import logging from pylons import request, response, session from pylons import tmpl_context as c from pylons.controllers.util import abort, redirect_to from gigblaster.lib.base import BaseController, render #import gigblaster.model as model log = logging.getLogger(__name__) class HelloController(BaseController): def index(self): # Return a rendered template # return render('/template.mako') # or, Return a response return 'Hello World' 11
  • 12. Twitter (gigblastr)$ easy_install python_twitter • In GigBlastr/controller/hello.py import twitter def tweet(self): api = twitter.Api(username='natea', password='xxxxxxx') status = api.PostUpdate('testing tweets from GAE') return status.text • Restart and visit http://localhost:8080/hello/tweet/index 12
  • 13. Eventful (gigblastr)$ easy_install eventful • In GigBlastr/controller/hello.py import eventful def evtful(self): api = eventful.API('xxxxxxxxxxxxx') events = api.call('/events/search', q='music', l='Cambridge, MA') for event in events['events']['event']: print quot;%s at %squot; % (event['title'], event['venue_name']) • Restart and visit http://localhost:8080/hello/evtful/index 13
  • 14. Upload app to GAE $ cd gigblastr $ /usr/bin/python2.5 /usr/local/google_appengine/appcfg.py update . • 973 files - whew! • If your app has more than 1000 files, you'll have to remove some unused eggs. 14
  • 15. Remove _speedups import simplejson File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/ simplejson/__init__.pyquot;, line 113, in <module> from encoder import JSONEncoder File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/ simplejson/encoder.pyquot;, line 6, in <module> from simplejson import _speedups File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/ simplejson/_speedups.pyquot;, line 7, in <module> __bootstrap__() File quot;/base/data/home/apps/gigblastr/1.8/lib/python2.5/site-packages/simplejson-1.8.1-py2.5-macosx-10.5-i386.egg/ simplejson/_speedups.pyquot;, line 5, in __bootstrap__ del __bootstrap__, __loader__ NameError: global name '__loader__' is not defined • Remove _speedups.py and _speedups.so from simplejson • They are trying to cache on the file system, which is a no-no on GAE. 15
  • 16. Guido, the creator of Python speaks! 16
  • 17. ianbicking to the rescue! Ian responds one week later 17
  • 18. Use httplib on GAE • In paste-deploy.py: ## If you want to use httplib but get socket errors, ## you should uncomment this line: appengine_monkey.install_httplib() 18
  • 19. No Twitter from GAE :( 19
  • 20. More info • Google App Engine http://code.google.com/appengine/ • Pylons http://pylonshq.com • Instructions for Pylons on GAE http://code.google.com/p/appengine-monkey/wiki/Pylons • DevHouseBoston http://devhouseboston.org 20
  • 21. Thanks! • To Ian Bicking for making appengine- monkey, making the instructions, and helping on IRC. • The kind folks in #pylons who helped me get my head around Pylons syntax 21