aboutsummaryrefslogtreecommitdiffstats
path: root/manage.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-01-19 15:57:06 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-01-19 15:57:06 +0000
commit9d76a3c52b8310726ec09e0262813f0438c21df6 (patch)
tree4acf47dce6c3aa75f8ad7c5cb56fe6486c2d64a7 /manage.py
init commit - from cookiecutter
Diffstat (limited to 'manage.py')
-rwxr-xr-xmanage.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/manage.py b/manage.py
new file mode 100755
index 0000000..81b5e0c
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+import os
+import sys
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
+
+ try:
+ from django.core.management import execute_from_command_line
+ except ImportError:
+ # The above import may fail for some other reason. Ensure that the
+ # issue is really that Django is missing to avoid masking other
+ # exceptions on Python 2.
+ try:
+ import django # noqa
+ except ImportError:
+ raise ImportError(
+ "Couldn't import Django. Are you sure it's installed and "
+ "available on your PYTHONPATH environment variable? Did you "
+ "forget to activate a virtual environment?"
+ )
+
+ raise
+
+ # This allows easy placement of apps within the interior
+ # ctrack directory.
+ current_path = os.path.dirname(os.path.abspath(__file__))
+ sys.path.append(os.path.join(current_path, "ctrack"))
+
+ execute_from_command_line(sys.argv)