SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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)
 

Similaire à 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
 

Similaire à 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
 

Plus 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.
 

Plus 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
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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