def real_main(): wsgi_app = request_cache.RequestCacheMiddleware(api_app) wsgi_app = profiler.ProfilerWSGIMiddleware(wsgi_app) wsgi_app = middleware.GAEBingoWSGIMiddleware(wsgi_app) if App.is_dev_server: try: # Run debugged app from werkzeug_debugger_appengine import get_debugged_app api_app.debug = True debugged_app = get_debugged_app(wsgi_app) CGIHandler().run(debugged_app) return debugged_app except Exception, e: api_app.debug = False logging.warning( "Error running debugging version of werkzeug app, running production version: %s" % e)
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app from gae_bingo import cache, dashboard, middleware, plots, blotter, api, redirect application = webapp.WSGIApplication([ ("/gae_bingo/persist", cache.PersistToDatastore), ("/gae_bingo/log_snapshot", cache.LogSnapshotToDatastore), ("/gae_bingo/blotter/ab_test", blotter.AB_Test), ("/gae_bingo/blotter/bingo", blotter.Bingo), ("/gae_bingo/redirect", redirect.Redirect), ("/gae_bingo/dashboard", dashboard.Dashboard), ("/gae_bingo/dashboard/export", dashboard.Export), ("/gae_bingo/api/v1/experiments", api.Experiments), ("/gae_bingo/api/v1/experiments/summary", api.ExperimentSummary), ("/gae_bingo/api/v1/experiments/conversions", api.ExperimentConversions), ("/gae_bingo/api/v1/experiments/control", api.ControlExperiment), ("/gae_bingo/api/v1/alternatives", api.Alternatives), ]) application = middleware.GAEBingoWSGIMiddleware(application) def main(): run_wsgi_app(application) if __name__ == "__main__": main()