working towards wsgi runnability

This commit is contained in:
Ben Adida 2013-08-25 10:52:57 -07:00
parent 5bbd7d59a4
commit d2c5f82b12
4 changed files with 13 additions and 10 deletions

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: gunicorn django.wsgi

View File

@ -1,8 +1,6 @@
import os
import sys
sys.path.append('/web/helios-server')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django.core.handlers.wsgi

View File

@ -1,11 +1,10 @@
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
import os
import sys
if __name__ == "__main__":
execute_manager(settings)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

5
wsgi.py Normal file
View File

@ -0,0 +1,5 @@
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()