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

Align with Django 3.1.6 behaviour for own management wrappers

> commit ec6d2531c59466924b645f314ac33f54470d7ac3
> Author: William Schwartz <wkschwartz@gmail.com>
> Date:   Mon Jan 4 08:50:49 2021 -0600
>
>     Fixed #32314 -- Fixed detection when started non-django modules with "python -m" in autoreloader.
>
>     django.utils.autoreload.get_child_arguments() detected when Python was
>     started with the `-m` option only for `django` module. This commit
>     changes the logic to check __spec__, see
>     https://docs.python.org/3/reference/import.html#main-spec
>
>     Now packages can implement their own __main__ with the runserver
>     command.

Thanks to William for breaking the API in a a.b.c.d.e patch-level
release :hearts:!
parent e44a03aa
No related branches found
No related tags found
1 merge request!483Resolve "runserver stopped working with aleksis-admin in Django 3.1.6"
Pipeline #5809 failed
......@@ -9,4 +9,9 @@ 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__)
execute_from_command_line(sys.argv)
if __name__ == "__main__":
sys.exit(aleksis_cmd())
......@@ -103,7 +103,7 @@ celery = ["Celery", "django-celery-results", "django-celery-beat", "django-celer
aleksis-builddeps = "*"
[tool.poetry.scripts]
aleksis-admin = 'aleksis.core.util.manage:aleksis_cmd'
aleksis-admin = 'aleksis.core.__main__:aleksis_cmd'
[tool.black]
line-length = 100
......
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