Bpstudy48

660 views

Published on

Published in: Technology
  • Be the first to comment

Bpstudy48

  1. 1. Google App Engine 2011 8 31 BP Study #482011 9 1
  2. 2. ✤ setomits ✤ : ✤ 2001 : CAC ✤ 2007 : ✤ 2008 : ✤ 2010 : ✤ 2011 : ←2011 9 1
  3. 3. Python ✤ CAC / ✤ Python ✤ ✤ ✤ ✤ UI2011 9 1
  4. 4. Python ✤ ✤ ✤ ✤ ✤ ✤ ✤ Web2011 9 1
  5. 5. Python ✤ ✤ Python ✤ Apache + mod_python ↓ ✤ ✤ ✤2011 9 1
  6. 6. Python ✤ ✤ ✤ ✤ ✤ Online to Offline - ✤ Google App Engine2011 9 1
  7. 7. ✤ → ✤ → ✤ → ✤ → ...2011 9 1
  8. 8. ✤ ✤ ✤ ✤ ✤ → Weak Ties ✤ Facebook / LinkedIn → Online to Offline2011 9 1
  9. 9. TIPS 1/6 ✤ GoogleAppEngineLauncher Preferences... : “Python Path”2011 9 1
  10. 10. TIPS 2/6 ✤ ✤ “Extra Flags” “--address=0.0.0.0” ✤ dev_appserver.py --help2011 9 1
  11. 11. TIPS 3/6 ✤ App Engine ✤ app name ✤ app.yaml UI memcached application: myapp application: myapp version: dev version: rel ... → dev.myapp.appspot.com → rel.myapp.appspot.com2011 9 1
  12. 12. TIPS 4/6 ✤ ✤ myapp.apspot.com appengine.google.com Versions ✤ 102011 9 1
  13. 13. TIPS 5/6 ✤ ✤ appengine_config.py ref: http://d.hatena.ne.jp/nullpobug/20110528/1306516902 ✤ Task Queue Cron ... ✤ basicauth.py2011 9 1
  14. 14. class AuthMiddleware(object): def __init__(self, application, realm, authdic): self.application = application self.realm = realm self.authdic = authdic def _allowed(self): return [Basic %s % base64.b64encode(%s:%s % (k, self.authdic[k])) for k in self.authdic] def _management_access(self, p): if p.startswith(/task/) or p.startswith(/cron/): return True else: return False def _authorized(self, a): if a in self._allowed(): return True else: return False def __call__(self, environ, start_response): auth_header = environ.get(HTTP_AUTHORIZATION) path_info = environ.get(PATH_INFO) if self._management_access(path_info) or self._authorized(auth_header): return self.application(environ, start_response) return auth_required_app(environ, start_response, self.realm)2011 9 1
  15. 15. TIPS 6/6 ✤ ✤ DateTimeProperty UTC ✤ cron.yaml UTC ✤ UTC2011 9 1
  16. 16. GAE ✤ OS ✤ ✤ ✤2011 9 1
  17. 17. GAE ✤ ✤ ✤ ✤ × http://hirukai.jp → ○ http://www.hirukai.jp ✤ Twitter OAuth ✤ IP http://stackoverflow.com/questions/3284205/twitter-rate-limit- exceeded-google-app-engine/32851272011 9 1

×