aboutsummaryrefslogtreecommitdiffstats
path: root/manage.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-13 17:26:25 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-13 17:26:25 +0100
commitefbbd480ddc62e695123d31c31d233b0df5155bd (patch)
treebc2fb465edd5050d83c97f280b1aac8e023fe3e5 /manage.py
After first pre-commit processing
Diffstat (limited to 'manage.py')
-rwxr-xr-xmanage.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/manage.py b/manage.py
new file mode 100755
index 0000000..c84a3bc
--- /dev/null
+++ b/manage.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+# ruff: noqa
+import os
+import sys
+from pathlib import Path
+
+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
+ 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
+ # pyblackbird_cc directory.
+ current_path = Path(__file__).parent.resolve()
+ sys.path.append(str(current_path / "pyblackbird_cc"))
+
+ execute_from_command_line(sys.argv)