-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (27 loc) · 928 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os, sys
from google.appengine.api import users
os.environ["DJANGO_SETTINGS_MODULE"] = "application.settings"
ROOT_PATH = os.path.dirname(__file__)
sys.path.append(ROOT_PATH)
#from google.appengine.dist import use_library
#use_library('django', '1.1')
sys.path.insert(0, "django.zip")
sys.path.insert(1, "gdata-2.0.15.zip")
from appenginepatcher.patch import patch_all
patch_all()
# 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.dispatch.dispatcher
# Unregister the rollback event handler.
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()