fix manage.py
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 12 May 2014 07:54:15 +0000 (16:54 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 12 May 2014 07:54:15 +0000 (16:54 +0900)
fsij/manage.py [deleted file]
manage.py [new file with mode: 0755]

diff --git a/fsij/manage.py b/fsij/manage.py
deleted file mode 100755 (executable)
index a2178ad..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/python
-from django.core.management import execute_manager
-try:
-    import settings
-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)
-
-if __name__ == "__main__":
-    execute_manager(settings)
diff --git a/manage.py b/manage.py
new file mode 100755 (executable)
index 0000000..5c99b10
--- /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", "fsij.settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)