SlideShare a Scribd company logo
1 of 66
Download to read offline
Google App Engine
                            Kosei Moriyama (cou929)
                                  Nov, 23, 2009




Wednesday, May 5, 2010
Agenda

                   • Google App Engine
                   • Getting Started
                   •


Wednesday, May 5, 2010
Google App Engine




Wednesday, May 5, 2010
Web



Wednesday, May 5, 2010
•
                         •
                         •
                   •
                         •
                         •
                   •

                   •         …




Wednesday, May 5, 2010
App Engine
                   •
                         •
                         •
                   •
                         •
                         •
                   •
                   •                      …




Wednesday, May 5, 2010
•     Python

                   •     Java

                           •      JVM



                           •      e.g., JRuby
                   •
                   •
                   •     App Engine

                           •      Google        , URL Fetch, Mail, memcache,

                   •     Cron



Wednesday, May 5, 2010
•     App Engine SDK

                          •   web

                          •   app engine



                          •   Python SDK / Java SDK
                   •     google


Wednesday, May 5, 2010
Getting Started



Wednesday, May 5, 2010
•
                         •   http://code.google.com/intl/ja/appengine/docs/python/gettingstarted/




Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
•     Python

                          •     http://www.python.org/download/
                          •     2.5

                          •     3.x

                   •     Python SDK

                          •     http://code.google.com/intl/ja/appengine/
                                downloads.html
                   •     Path



Wednesday, May 5, 2010
• dev_appserver.py
                      •
                   • appcfg.py
                      • app engine


Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
Hello World!

                   •
                         •          app.yaml

                         • python       main.py




Wednesday, May 5, 2010
app.yaml

                   •
                         • id, version, runtime ...
                   •
                         • url

Wednesday, May 5, 2010
main.py


                   • print



Wednesday, May 5, 2010
App Engine web


                   •



Wednesday, May 5, 2010
App Engine web

                   • app engine             web
                         CGI

                               request                       CGI
                                                                              app.yaml

                                          app engine                routing
                    client
                                          web server
                               response                CGI
                                                                   foo.py      bar.py    baz.py




Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
Webapp
                   • CGI
                      ‣                     ,

                   • Python                     CGI



                         • Django, Cherry.py, Pylons, web.py
Wednesday, May 5, 2010
Webapp

                   •
                   •
                   • app engine


Wednesday, May 5, 2010
3
                   •     RequestHandler    (   )

                          •                ,

                   •     WSGIApplication

                          •                        URL



                   •     main

                          •     CGI                WSGIApplication



Wednesday, May 5, 2010
main.py
                   •     webapp, run_wsgi_app

                   •     MainPage

                           •    webapp.RequestHandler

                   •     def get(self)
                           •    GET

                   •     response.headers()
                   •     response.out.write()
                   •     webapp.WSGIApplication()
                   •     run_wsgi_app()



Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
Google

                   •     users     import

                   •     user.get_current_user()
                           •                        user

                           •                       none

                   •     self.redirect(dest_uri)
                           •     dest_uri

                   •     users.create_login_url(dest_uri)
                           •
                           •                               , dest_uri



Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
• def post(self)
                      • POST
                   • request.get(‘name’)
                      • “name”

Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
•
                   •
                   •
                   • not RDBMS

Wednesday, May 5, 2010
Entity
                                          put()


                         application                    Data Store




                                       List of Entity
                                           GQL


Wednesday, May 5, 2010
Entity
                   •     Entity
                         •   db.Model

                         •          Property key

                   •     Property
                         •   db.fooProperty()

                   •     Key
                         •     entity

                         •   Data store



Wednesday, May 5, 2010
class Pet(db.Model):
                           name = db.StringProperty(required=True)
                           type = db.StringProperty(required=True, choices=set(["cat", "dog", "bird"]))
                           birthdate = db.DateProperty()
                           weight_in_pounds = db.IntegerProperty()
                           spayed_or_neutered = db.BooleanProperty()
                           owner = db.UserProperty(required=True)




Wednesday, May 5, 2010
•                                                , put()



               •
                         greeting = Greeting(author = users.get_current_user(), content =
                         self.request.get('content'))

                         greeting.put()




Wednesday, May 5, 2010
GQL
                   •     db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC LIMIT 10")

                   •     greetings Greeting

                           •            for greeting in greetings:

                   •
                           •   db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC
                               LIMIT 10")

                           •   Greeting.gql("ORDER BY date DESC LIMIT 10")

                               •   "SELECT * FROM Greeting"          (                       )




Wednesday, May 5, 2010
• Greeting.all()
                         greetings.filter("author =",
                         users.get_current_user())
                         greetings.order("-date")
               •
               •         Greeting.all().filter("author =", users.get_current_user()).order("-date")




Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
• EZT, Cheetah, ClearSilver, Quixote, Django
                   • Django


Wednesday, May 5, 2010
• template html
                   • template import
                   • template Dictionary
                   • template.render(path, values)

Wednesday, May 5, 2010
Django template
                   •           {{ variable }}

                   •             {% foo %}

                         • {% for * %}
                         • {% if * %}
                         • {% include * %}

Wednesday, May 5, 2010
template

                   • Django template
                    • class template
                   • {% extends foo.html %}
                   • {% block bar %}

Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
•     index.html   ,



                          •                                      ok

                   •

                          •       , css, JavaScript,   , Flash


Wednesday, May 5, 2010
app.yaml
                         - url: /stylesheets
                          static_dir: stylesheets


               •                                        /stylesheets/*
                                                , stylesheets




Wednesday, May 5, 2010
•
                   •     Hello World!
                   •     Webapp

                   •     Google

                   •
                   •
                   •
                   •
                   •

Wednesday, May 5, 2010
•
                           •   http://appengine.google.com/
                   •     app.yaml

                           •   application:                        ID

                   •
                           •   appcfg.py update helloworld/
                           •
                           •   http://application-id.appspot.com



Wednesday, May 5, 2010
Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
memcach

                   •
                   • memchached
                   • key-value store


Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
URL Fetch

                   • HTTP/HTTPS       ,


                                  /

                   • Google               ,




Wednesday, May 5, 2010
• urllib, urllib2, httplib
                      •            google

                   • app engine api


Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
Mail


                   •



Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
•
                         •
                         •       1

                         •
                         •
                         •   (       )




Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
Cron


                   •
                   • cron.yaml


Wednesday, May 5, 2010
cron.yaml
                         cron:
                         - description: daily summary job
                          url: /tasks/summary
                          schedule: every 24 hours
                         - description: monday morning mailout
                          url: /mail/weekly
                          schedule: every monday of month 09:00
                          timezone: Australia/NSW


Wednesday, May 5, 2010
• every 5 minutes
                   • every 12 hours
                   • 2nd,third mon,wed,thu of march 17:00
                   • every monday of month 09:00
                   • 1st monday of sep,oct,nov 17:00

Wednesday, May 5, 2010
app.yaml



                         handlers:
                         - url: /report/weekly
                          script: reports.py
                          login: admin




Wednesday, May 5, 2010
• memcache
                   • URL Fetch
                   • Mail
                   •
                   • Cron (      )

                   •
Wednesday, May 5, 2010
•     pure python          ok

                           •
                   •
                           •   Antlr 3
                           •   Django 0.9.6
                           •   PyCrypto
                           •   WebOb
                           •   YAML
                           •   zipimport



Wednesday, May 5, 2010
Wednesday, May 5, 2010

More Related Content

Similar to Introduction To Google App Engine

Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06Skills Matter
 
Debugging your JavaScript
Debugging your JavaScriptDebugging your JavaScript
Debugging your JavaScriptDiogo Antunes
 
Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Skills Matter
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby ConferenceJohn Woodell
 
URIplay for Media Futures Conference (2009)
URIplay for Media Futures Conference (2009)URIplay for Media Futures Conference (2009)
URIplay for Media Futures Conference (2009)Chris Jackson
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathonikailan
 
"How Mozilla Uses Selenium"
"How Mozilla Uses Selenium""How Mozilla Uses Selenium"
"How Mozilla Uses Selenium"Stephen Donner
 
夜宴24期《这段时间》
夜宴24期《这段时间》夜宴24期《这段时间》
夜宴24期《这段时间》Koubei Banquet
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLAndreas Jung
 
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方Atsushi Harada
 
Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)
Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)
Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)John Adams
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合Carl Su
 
Social Network Technologies and Usages
Social Network Technologies and UsagesSocial Network Technologies and Usages
Social Network Technologies and UsagesPatrick Chanezon
 
การค้นหาข้อมูลจากอินเทอร์เน็ต
การค้นหาข้อมูลจากอินเทอร์เน็ตการค้นหาข้อมูลจากอินเทอร์เน็ต
การค้นหาข้อมูลจากอินเทอร์เน็ตwandee8167
 
URIplay for Open Video Conference (2009)
URIplay for Open Video Conference (2009)URIplay for Open Video Conference (2009)
URIplay for Open Video Conference (2009)Chris Jackson
 
Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発Yusuke Muraoka
 
Building mobile apps with JavaScript and PHP
Building mobile apps with JavaScript and PHPBuilding mobile apps with JavaScript and PHP
Building mobile apps with JavaScript and PHPfunkatron
 

Similar to Introduction To Google App Engine (20)

Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06Phone gap nikolaionken-08-06
Phone gap nikolaionken-08-06
 
Debugging your JavaScript
Debugging your JavaScriptDebugging your JavaScript
Debugging your JavaScript
 
Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06Html5 apps nikolaionken-08-06
Html5 apps nikolaionken-08-06
 
Red Dirt Ruby Conference
Red Dirt Ruby ConferenceRed Dirt Ruby Conference
Red Dirt Ruby Conference
 
URIplay for Media Futures Conference (2009)
URIplay for Media Futures Conference (2009)URIplay for Media Futures Conference (2009)
URIplay for Media Futures Conference (2009)
 
2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon2011 june-kuala-lumpur-gtug-hackathon
2011 june-kuala-lumpur-gtug-hackathon
 
"How Mozilla Uses Selenium"
"How Mozilla Uses Selenium""How Mozilla Uses Selenium"
"How Mozilla Uses Selenium"
 
夜宴24期《这段时间》
夜宴24期《这段时间》夜宴24期《这段时间》
夜宴24期《这段时间》
 
Oscon 2010
Oscon 2010Oscon 2010
Oscon 2010
 
Kotti 紹介
Kotti 紹介Kotti 紹介
Kotti 紹介
 
BRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQLBRAINREPUBLIC - Powered by no-SQL
BRAINREPUBLIC - Powered by no-SQL
 
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
普通のwebエンジニアでも出来る、ド素人からの機械学習のはじめ方
 
Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)
Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)
Billions of hits: Scaling Twitter (Web 2.0 Expo, SF)
 
手機自動化測試和持續整合
手機自動化測試和持續整合手機自動化測試和持續整合
手機自動化測試和持續整合
 
Social Network Technologies and Usages
Social Network Technologies and UsagesSocial Network Technologies and Usages
Social Network Technologies and Usages
 
Railsconf 2010
Railsconf 2010Railsconf 2010
Railsconf 2010
 
การค้นหาข้อมูลจากอินเทอร์เน็ต
การค้นหาข้อมูลจากอินเทอร์เน็ตการค้นหาข้อมูลจากอินเทอร์เน็ต
การค้นหาข้อมูลจากอินเทอร์เน็ต
 
URIplay for Open Video Conference (2009)
URIplay for Open Video Conference (2009)URIplay for Open Video Conference (2009)
URIplay for Open Video Conference (2009)
 
Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発Pythonistaで始めるiOSプロトタイプ開発
Pythonistaで始めるiOSプロトタイプ開発
 
Building mobile apps with JavaScript and PHP
Building mobile apps with JavaScript and PHPBuilding mobile apps with JavaScript and PHP
Building mobile apps with JavaScript and PHP
 

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Introduction To Google App Engine

  • 1. Google App Engine Kosei Moriyama (cou929) Nov, 23, 2009 Wednesday, May 5, 2010
  • 2. Agenda • Google App Engine • Getting Started • Wednesday, May 5, 2010
  • 5. • • • • • • • … Wednesday, May 5, 2010
  • 6. App Engine • • • • • • • • … Wednesday, May 5, 2010
  • 7. Python • Java • JVM • e.g., JRuby • • • App Engine • Google , URL Fetch, Mail, memcache, • Cron Wednesday, May 5, 2010
  • 8. App Engine SDK • web • app engine • Python SDK / Java SDK • google Wednesday, May 5, 2010
  • 10. • http://code.google.com/intl/ja/appengine/docs/python/gettingstarted/ Wednesday, May 5, 2010
  • 11. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 12. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 13. Python • http://www.python.org/download/ • 2.5 • 3.x • Python SDK • http://code.google.com/intl/ja/appengine/ downloads.html • Path Wednesday, May 5, 2010
  • 14. • dev_appserver.py • • appcfg.py • app engine Wednesday, May 5, 2010
  • 15. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 16. Hello World! • • app.yaml • python main.py Wednesday, May 5, 2010
  • 17. app.yaml • • id, version, runtime ... • • url Wednesday, May 5, 2010
  • 18. main.py • print Wednesday, May 5, 2010
  • 19. App Engine web • Wednesday, May 5, 2010
  • 20. App Engine web • app engine web CGI request CGI app.yaml app engine routing client web server response CGI foo.py bar.py baz.py Wednesday, May 5, 2010
  • 21. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 22. Webapp • CGI ‣ , • Python CGI • Django, Cherry.py, Pylons, web.py Wednesday, May 5, 2010
  • 23. Webapp • • • app engine Wednesday, May 5, 2010
  • 24. 3 • RequestHandler ( ) • , • WSGIApplication • URL • main • CGI WSGIApplication Wednesday, May 5, 2010
  • 25. main.py • webapp, run_wsgi_app • MainPage • webapp.RequestHandler • def get(self) • GET • response.headers() • response.out.write() • webapp.WSGIApplication() • run_wsgi_app() Wednesday, May 5, 2010
  • 26. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 27. Google • users import • user.get_current_user() • user • none • self.redirect(dest_uri) • dest_uri • users.create_login_url(dest_uri) • • , dest_uri Wednesday, May 5, 2010
  • 28. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 29. • def post(self) • POST • request.get(‘name’) • “name” Wednesday, May 5, 2010
  • 30. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 31. • • • not RDBMS Wednesday, May 5, 2010
  • 32. Entity put() application Data Store List of Entity GQL Wednesday, May 5, 2010
  • 33. Entity • Entity • db.Model • Property key • Property • db.fooProperty() • Key • entity • Data store Wednesday, May 5, 2010
  • 34. class Pet(db.Model): name = db.StringProperty(required=True) type = db.StringProperty(required=True, choices=set(["cat", "dog", "bird"])) birthdate = db.DateProperty() weight_in_pounds = db.IntegerProperty() spayed_or_neutered = db.BooleanProperty() owner = db.UserProperty(required=True) Wednesday, May 5, 2010
  • 35. , put() • greeting = Greeting(author = users.get_current_user(), content = self.request.get('content')) greeting.put() Wednesday, May 5, 2010
  • 36. GQL • db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC LIMIT 10") • greetings Greeting • for greeting in greetings: • • db.GqlQuery("SELECT * FROM Greeting ORDER BY date DESC LIMIT 10") • Greeting.gql("ORDER BY date DESC LIMIT 10") • "SELECT * FROM Greeting" ( ) Wednesday, May 5, 2010
  • 37. • Greeting.all() greetings.filter("author =", users.get_current_user()) greetings.order("-date") • • Greeting.all().filter("author =", users.get_current_user()).order("-date") Wednesday, May 5, 2010
  • 38. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 39. • EZT, Cheetah, ClearSilver, Quixote, Django • Django Wednesday, May 5, 2010
  • 40. • template html • template import • template Dictionary • template.render(path, values) Wednesday, May 5, 2010
  • 41. Django template • {{ variable }} • {% foo %} • {% for * %} • {% if * %} • {% include * %} Wednesday, May 5, 2010
  • 42. template • Django template • class template • {% extends foo.html %} • {% block bar %} Wednesday, May 5, 2010
  • 43. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 44. index.html , • ok • • , css, JavaScript, , Flash Wednesday, May 5, 2010
  • 45. app.yaml - url: /stylesheets static_dir: stylesheets • /stylesheets/* , stylesheets Wednesday, May 5, 2010
  • 46. • Hello World! • Webapp • Google • • • • • Wednesday, May 5, 2010
  • 47. • http://appengine.google.com/ • app.yaml • application: ID • • appcfg.py update helloworld/ • • http://application-id.appspot.com Wednesday, May 5, 2010
  • 49. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 50. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 51. memcach • • memchached • key-value store Wednesday, May 5, 2010
  • 52. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 53. URL Fetch • HTTP/HTTPS , / • Google , Wednesday, May 5, 2010
  • 54. • urllib, urllib2, httplib • google • app engine api Wednesday, May 5, 2010
  • 55. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 56. Mail • Wednesday, May 5, 2010
  • 57. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 58. • • 1 • • • ( ) Wednesday, May 5, 2010
  • 59. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 60. Cron • • cron.yaml Wednesday, May 5, 2010
  • 61. cron.yaml cron: - description: daily summary job url: /tasks/summary schedule: every 24 hours - description: monday morning mailout url: /mail/weekly schedule: every monday of month 09:00 timezone: Australia/NSW Wednesday, May 5, 2010
  • 62. • every 5 minutes • every 12 hours • 2nd,third mon,wed,thu of march 17:00 • every monday of month 09:00 • 1st monday of sep,oct,nov 17:00 Wednesday, May 5, 2010
  • 63. app.yaml handlers: - url: /report/weekly script: reports.py login: admin Wednesday, May 5, 2010
  • 64. • memcache • URL Fetch • Mail • • Cron ( ) • Wednesday, May 5, 2010
  • 65. pure python ok • • • Antlr 3 • Django 0.9.6 • PyCrypto • WebOb • YAML • zipimport Wednesday, May 5, 2010