Move around manage.py and create wsgi.py for django 1.8
authorMagnus Hagander <magnus@hagander.net>
Wed, 6 Jan 2016 15:28:25 +0000 (16:28 +0100)
committerMagnus Hagander <magnus@hagander.net>
Wed, 6 Jan 2016 15:28:25 +0000 (16:28 +0100)
manage.py [new file with mode: 0755]
pgcommitfest/manage.py [deleted file]
pgcommitfest/wsgi.py [new file with mode: 0644]

diff --git a/manage.py b/manage.py
new file mode 100755 (executable)
index 0000000..55f994c
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pgcommitfest.settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)
diff --git a/pgcommitfest/manage.py b/pgcommitfest/manage.py
deleted file mode 100755 (executable)
index 3e4eedc..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env python
-from django.core.management import execute_manager
-import imp
-try:
-    imp.find_module('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" % __file__)
-    sys.exit(1)
-
-import settings
-
-if __name__ == "__main__":
-    execute_manager(settings)
diff --git a/pgcommitfest/wsgi.py b/pgcommitfest/wsgi.py
new file mode 100644 (file)
index 0000000..821a477
--- /dev/null
@@ -0,0 +1,16 @@
+"""
+WSGI config for pgcommitfest project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pgcommitfest.settings")
+
+application = get_wsgi_application()