diff --git a/python/pluginResources/app.yaml b/python/pluginResources/app.yaml new file mode 100644 index 000000000000..1c12bfe3caf1 --- /dev/null +++ b/python/pluginResources/app.yaml @@ -0,0 +1,8 @@ +application: {0} +version: 1 +runtime: python +api_version: 1 + +handlers: +- url: /.* + script: main.py diff --git a/python/pluginResources/main.py b/python/pluginResources/main.py new file mode 100644 index 000000000000..7555f5fcde97 --- /dev/null +++ b/python/pluginResources/main.py @@ -0,0 +1,33 @@ +import os,sys +os.environ['DJANGO_SETTINGS_MODULE'] = '{0}.settings' + +# Google App Engine imports. +from google.appengine.ext.webapp import util + +# Force Django to reload its settings. +from django.conf import settings +settings._target = None + +import django.core.handlers.wsgi +import django.core.signals +import django.db +import django.dispatch.dispatcher + +# Log errors. +#django.dispatch.dispatcher.connect( +# log_exception, django.core.signals.got_request_exception) + +# Unregister the rollback event handler. +django.dispatch.dispatcher.disconnect( + django.db._rollback_on_exception, + django.core.signals.got_request_exception) + +def main(): + # Create a Django application for WSGI. + application = django.core.handlers.wsgi.WSGIHandler() + + # Run the WSGI CGI handler with that application. + util.run_wsgi_app(application) + +if __name__ == '__main__': + main() \ No newline at end of file