18 lines
607 B
Python
18 lines
607 B
Python
#!/usr/bin/env python
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
def main():
|
|
# Ensure the repository root (containing the 'project' package) is on sys.path.
|
|
repo_root = Path(__file__).resolve().parent
|
|
if str(repo_root) not in sys.path:
|
|
sys.path.insert(0, str(repo_root))
|
|
# Force correct settings module even if an old environment var (e.g. 'dali.settings') lingers.
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.config.settings'
|
|
from django.core.management import execute_from_command_line
|
|
execute_from_command_line(sys.argv)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|