Changes between Initial Version and Version 1 of Ticket #32915, comment 23
- Timestamp:
- Apr 22, 2026, 9:17:10 AM (9 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32915, comment 23
initial v1 3 3 The underlying problem is that when `DJANGO_SETTINGS_MODULE` fails to import, `ManagementUtility.execute()` [https://github.com/django/django/blob/a77be30a4346d111beaf366dcee4934734458a48/django/core/management/__init__.py#L384-L387 stashes the exception] on `self.settings_exception` and continues silently. 4 4 5 There is only one code path that surfaces it to the user: `main_help_text()`, reached by running ./manage.pywith no arguments. Every other invocation exits without mentioning that settings failed to load, so end users have no way to diagnose the misconfiguration and remedy it.5 There is only one code path that surfaces it to the user: `main_help_text()`, reached by running `./manage.py` with no arguments. Every other invocation exits without mentioning that settings failed to load, so end users have no way to diagnose the misconfiguration and remedy it. 6 6 7 7 The user-facing problem is more significant than just the missing traceback on runserver. Because `settings.configured` stays `False`, `get_commands()` returns only the django.core commands and every other command defined by an app in `INSTALLED_APPS` silently disappears. The user runs `./manage.py actual_custom_command`, gets "Unknown command: 'actual_custom_command'", and is told nothing about why. Since we haven't shown the user the real error with their settings, they're getting mislead about the simplest way to fix the issue.