diff options
author | Markus Krogh <markus@nordu.net> | 2017-06-02 13:19:30 +0200 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2017-06-02 13:19:30 +0200 |
commit | 934702f61f1cbdbf001ebb598c22c75efa247645 (patch) | |
tree | b0c6725a8c8a682b421aa35eea9662d7fff31bd6 /src/manage.py | |
parent | 41afbaae97384968df6312cbe570305208b2216e (diff) |
Django 1.11 compatible and cleaned up
Diffstat (limited to 'src/manage.py')
-rw-r--r-- | src/manage.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/manage.py b/src/manage.py new file mode 100644 index 0000000..4015a97 --- /dev/null +++ b/src/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pwman.settings") + 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 + execute_from_command_line(sys.argv) |