Created
May 24, 2013 19:52
-
-
Save mcnemesis/5646069 to your computer and use it in GitHub Desktop.
My Django WSGI bootstrap script that is *so generic* it might work as a default replacement in any standard Django project. If you created your project using the default: django-admin.py startproject PROJECT, then just try switching your PROJECT/PROJECT/wsgi.py with this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys | |
base = os.path.dirname(os.path.dirname(__file__)) | |
base_parent = os.path.dirname(base) | |
sys.path.append(base) | |
sys.path.append(base_parent) | |
os.environ['DJANGO_SETTINGS_MODULE'] = '%s.settings' % os.path.basename( os.path.dirname(__file__) ) | |
import django.core.handlers.wsgi | |
application = django.core.handlers.wsgi.WSGIHandler() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment