Skip to content
Snippets Groups Projects
Verified Commit 77ed43d8 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Trick autoreloader to think we are django-admin in aleksis-admin

Follow-up on 2f7ccc1d
parent 3e2f3389
No related branches found
No related tags found
1 merge request!484Resolve "Relative imports fail when __main__ is not called correctly"
Pipeline #5815 passed
......@@ -3,13 +3,14 @@
import os
import sys
import django.__main__
from django.core.management import execute_from_command_line
def aleksis_cmd():
"""Run django-admin command with correct settings path."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "aleksis.core.settings")
sys.argv[0] = os.path.dirname(__file__)
sys.argv[0] = django.__main__.__file__
execute_from_command_line(sys.argv)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment