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

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 

Recently uploaded (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
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.
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 

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