Guest User

Untitled

a guest
May 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import os
  2. import sys
  3. import logging
  4.  
  5. from appengine_django import InstallAppengineHelperForDjango
  6. InstallAppengineHelperForDjango()
  7.  
  8. from appengine_django import have_django_zip
  9. from appengine_django import django_zip_path
  10.  
  11. # Google App Engine imports.
  12. from google.appengine.ext.webapp import util
  13.  
  14. # Import the part of Django that we use here.
  15. import django.core.handlers.wsgi
  16.  
  17. def main():
  18. # Ensure the Django zipfile is in the path if required.
  19. if have_django_zip and django_zip_path not in sys.path:
  20. sys.path.insert(1, django_zip_path)
  21.  
  22. # Create a Django application for WSGI.
  23. application = django.core.handlers.wsgi.WSGIHandler()
  24.  
  25. # Run the WSGI CGI handler with that application.
  26. util.run_wsgi_app(application)
  27.  
  28. if __name__ == '__main__':
  29. main()
Add Comment
Please, Sign In to add comment