Created
April 2, 2015 00:27
-
-
Save creimers/48d0ba093c1a7fbdebf0 to your computer and use it in GitHub Desktop.
wsgi.py
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 | |
from django.core.handlers.wsgi import WSGIHandler | |
import django | |
class WSGIEnvironment(WSGIHandler): | |
def __call__(self, environ, start_response): | |
os.environ['DATABASE_URL'] = environ['DATABASE_URL'] | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_app.settings") | |
django.setup() | |
return super(WSGIEnvironment, self).__call__(environ, start_response) | |
application = WSGIEnvironment() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment