From eeed2b8ae5dd1956d2bf127c7c986fa53792553c Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Mon, 19 Jan 2026 11:56:22 -0500 Subject: [PATCH] django: Add --no-imports option With django updated to 5.2 then the django shell commands load imports at startup which flood stdout with logs and break workflows https://docs.djangoproject.com/en/dev/releases/5.2/#automatic-models-import-in-the-shell Adding --no-imports to the cli call solves the issue. https://docs.djangoproject.com/en/5.2/ref/django-admin/#cmdoption-shell-no-imports Signed-off-by: Dimitri Savineau --- roles/installer/tasks/initialize_django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/installer/tasks/initialize_django.yml b/roles/installer/tasks/initialize_django.yml index ab2fe1c4..031bbcd8 100644 --- a/roles/installer/tasks/initialize_django.yml +++ b/roles/installer/tasks/initialize_django.yml @@ -8,7 +8,7 @@ bash -c "echo 'from django.contrib.auth.models import User; nsu = User.objects.filter(is_superuser=True, username=\"{{ admin_user }}\").count(); exit(0 if nsu > 0 else 1)' - | awx-manage shell" + | awx-manage shell --no-imports" ignore_errors: true register: users_result changed_when: users_result.return_code > 0