2011-01-12

have_app_server vs. on_production_server

사실 하고 싶은 건, (app id, on production server) 조합으로 적합한 facebook setting 을 로딩하는 건데.. 웬지 잘 안되었던 것 같은 느낌 :)

from google.appengine.api import apiproxy_stub_map
import os
have_appserver = bool(apiproxy_stub_map.apiproxy.GetStub('datastore_v3'))
on_production_server = have_appserver and \
  not os.environ.get('SERVER_SOFTWARE', '').lower().startswith('devel')

comments powered by Disqus