2013-08-14 22:01:41 +04:00
|
|
|
#!/usr/bin/env python
|
2024-02-13 13:57:53 +03:00
|
|
|
# ruff: noqa
|
2013-08-14 22:01:41 +04:00
|
|
|
import os
|
|
|
|
import sys
|
2019-07-08 01:35:09 +03:00
|
|
|
from pathlib import Path
|
2013-08-14 22:01:41 +04:00
|
|
|
|
2018-04-09 01:03:29 +03:00
|
|
|
if __name__ == "__main__":
|
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
|
2013-08-14 22:01:41 +04:00
|
|
|
|
2016-09-15 06:41:48 +03:00
|
|
|
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:
|
2024-02-13 13:57:53 +03:00
|
|
|
import django
|
2016-09-15 06:41:48 +03:00
|
|
|
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?"
|
|
|
|
)
|
2018-04-09 01:03:29 +03:00
|
|
|
|
2016-09-15 06:41:48 +03:00
|
|
|
raise
|
2017-04-13 20:48:44 +03:00
|
|
|
|
|
|
|
# This allows easy placement of apps within the interior
|
|
|
|
# {{ cookiecutter.project_slug }} directory.
|
2019-07-08 01:35:09 +03:00
|
|
|
current_path = Path(__file__).parent.resolve()
|
|
|
|
sys.path.append(str(current_path / "{{ cookiecutter.project_slug }}"))
|
2017-04-13 20:48:44 +03:00
|
|
|
|
2013-08-14 22:01:41 +04:00
|
|
|
execute_from_command_line(sys.argv)
|