[Django] #32915: ./manage runserver --nostatic still doesn't return a traceback

91 views
Skip to first unread message

Django

unread,
Jul 10, 2021, 10:09:25 AM7/10/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Bug | Status: new
Component: Core | Version: 3.2
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Maybe its regression, related to:
https://code.djangoproject.com/ticket/27522:

```
> python manage.py runserver --nostatic
usage: manage.py runserver [-h] [--ipv6] [--nothreading] [--noreload]
[--version] [-v {0,1,2,3}] [--settings SETTINGS]
[--pythonpath PYTHONPATH] [--traceback] [--no-
color] [--force-color]
[addrport]
manage.py runserver: error: unrecognized arguments: --nostatic
```

```
> python manage.py runserver
python manage.py runserver
Traceback (most recent call last):
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/commands/runserver.py", line 61, in
execute
super().execute(*args, **options)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/commands/runserver.py", line 68, in handle
if not settings.DEBUG and not settings.ALLOWED_HOSTS:
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/conf/__init__.py", line 82, in __getattr__
self._setup(name)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/conf/__init__.py", line 69, in _setup
self._wrapped = Settings(settings_module)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/conf/__init__.py", line 170, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in
_find_and_load_unlocked
ModuleNotFoundError: No module named 'dist.plug.settings'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "manage.py", line 16, in <module>
execute_from_command_line(sys.argv)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/__init__.py", line 419, in
execute_from_command_line
utility.execute()
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/core/management/base.py", line 367, in run_from_argv
connections.close_all()
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/db/utils.py", line 208, in close_all
for alias in self:
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/utils/connection.py", line 73, in __iter__
return iter(self.settings)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/utils/functional.py", line 48, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/utils/connection.py", line 45, in settings
self._settings = self.configure_settings(self._settings)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/db/utils.py", line 144, in configure_settings
databases = super().configure_settings(databases)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/utils/connection.py", line 50, in configure_settings
settings = getattr(django_settings, self.settings_name)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/conf/__init__.py", line 82, in __getattr__
self._setup(name)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/conf/__init__.py", line 69, in _setup
self._wrapped = Settings(settings_module)
File "/home/michael/venv/project/lib/python3.8/site-
packages/django/conf/__init__.py", line 170, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in
import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in
_find_and_load_unlocked
ModuleNotFoundError: No module named 'dist.plug.settings'
```

Its a ligit error, just hidden by `--nostatic`

--
Ticket URL: <https://code.djangoproject.com/ticket/32915>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 10, 2021, 2:17:57 PM7/10/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Old description:

New description:

--

Comment:

Thanks for the report!

Bisected to c6864a01b25591d3a709da8071413b69c9e35341.

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:1>

Django

unread,
Jul 11, 2021, 12:01:26 PM7/11/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned

Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rohith P R):

* owner: nobody => Rohith P R
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:2>

Django

unread,
Jul 11, 2021, 2:42:15 PM7/11/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rohith P R):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:3>

Django

unread,
Jul 11, 2021, 11:59:37 PM7/11/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:4>

Django

unread,
Jul 12, 2021, 3:30:16 AM7/12/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rohith P R):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:5>

Django

unread,
Jul 12, 2021, 4:39:46 AM7/12/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:6>

Django

unread,
Jul 12, 2021, 10:05:43 AM7/12/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rohith P R):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:7>

Django

unread,
Jul 23, 2021, 1:14:06 AM7/23/21
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1

* needs_tests: 0 => 1


Comment:

It's WIP

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:8>

Django

unread,
Jan 5, 2022, 2:52:11 PM1/5/22
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rohith P R):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:9>

Django

unread,
Feb 2, 2022, 1:43:28 AM2/2/22
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Rohith P
| R
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:10>

Django

unread,
Mar 13, 2022, 2:47:28 PM3/13/22
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: (none)
Type: Bug | Status: new

Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Rohith P R):

* owner: Rohith P R => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:11>

Django

unread,
Nov 28, 2022, 11:57:46 AM11/28/22
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: bcail
Type: Bug | Status: assigned

Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bcail):

* cc: bcail (added)


* needs_better_patch: 1 => 0

* status: new => assigned

* owner: (none) => bcail
* needs_tests: 1 => 0


Comment:

Opened a new PR from the previous one:
https://github.com/django/django/pull/16337

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:12>

Django

unread,
Feb 3, 2023, 6:30:55 AM2/3/23
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: bcail
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:13>

Django

unread,
Mar 1, 2024, 8:56:39 AM3/1/24
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: (none)
Type: Bug | Status: new
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bcail):

* owner: bcail => (none)
* status: assigned => new

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:14>

Django

unread,
Mar 18, 2024, 2:44:30 AM3/18/24
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: (none)
Type: Bug | Status: new
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:15>

Django

unread,
Jun 9, 2024, 4:58:07 AM6/9/24
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Paul Schilling):

* owner: (none) => Paul Schilling
* status: new => assigned

Comment:

The previous PR's focused on avoiding/working aroung the `ImportError`
introduced by c6864a01b25591d3a709da8071413b69c9e35341. I believe this is
treating the symptoms rather than the cause.

The `runserver` command is split in two: the "standard" command in
`core/management/commands/runserver.py` and the special command in
`contrib/staticfiles/commands/runserver.py`. The latter adds `--nostatic`
and `--insecure` to the arguments. However, this module imports `settings`
from `django.conf`. If `settings` doesn't exist or has errors,
`contrib/staticfiles/commands/runserver.py` cannot be loaded either. As a
result, the `--nostatic` argument is not recognized because it hasn't been
added (the same is true of `--insecure`, although this hasn't been
reported).

The problem can be solved by merging the two commands. The `runserver`
command is simplified, and the code that introduced the `ImportError` can
be left as is.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:16>

Django

unread,
Nov 13, 2024, 3:01:00 PM11/13/24
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bcail):

* needs_better_patch: 1 => 0

Comment:

I think [https://github.com/django/django/pull/16337 this PR] could be
reviewed. Or, if the decision is to go with
[https://github.com/django/django/pull/18260 the other PR], I can close
mine.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:17>

Django

unread,
Dec 19, 2024, 7:53:21 AM12/19/24
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

Comment:

Had a look at both PRs and, from what I can tell, they both need some work
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:18>

Django

unread,
May 6, 2025, 8:51:43 AM5/6/25
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0
* needs_docs: 0 => 1

Comment:

The new attribute needs a release note and documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:19>

Django

unread,
May 29, 2025, 9:56:36 AM5/29/25
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

#36422 was a dupe, which is worth looking at to ensure the fix for this
ticket covers that use case as well. That means including introspection of
`ImproperlyConfigured` to determine if it emanated from a settings module
before deciding to swallow it.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:20>

Django

unread,
May 29, 2025, 9:57:14 AM5/29/25
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* cc: Lily Acorn (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:21>

Django

unread,
Aug 7, 2025, 2:33:07 PM8/7/25
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

#36544 was another dupe.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:22>

Django

unread,
Apr 22, 2026, 10:15:43 AM (9 days ago) Apr 22
to django-...@googlegroups.com
#32915: ./manage runserver --nostatic still doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Brian Helba):

I believe that #36422 (closed as a duplicate of this one) is actually
closer to the root cause, and this ticket is tracking a symptom.

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.

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.

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.

This ticket is focused on that same user problem: after a settings
failure, `django.contrib.staticfiles` is silently not added to
`INSTALLED_APPS`, so the `--nostatic` option disappears (since `runserver`
is never overridden). The best solution isn't to patch `--nostatic` into
the core command, it's to confront the user with the settings failure;
once they fix that, `INSTALLED_APPS` and custom commands will work again.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:23>

Django

unread,
Apr 22, 2026, 10:42:57 AM (9 days ago) Apr 22
to django-...@googlegroups.com
#32915: Exceptions from settings modules are hidden when running management
commands
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* summary: ./manage runserver --nostatic still doesn't return a traceback
=>
Exceptions from settings modules are hidden when running management
commands

Comment:

Broadened issue title to reflect scope.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:24>

Django

unread,
Apr 22, 2026, 2:31:43 PM (9 days ago) Apr 22
to django-...@googlegroups.com
#32915: Exceptions from settings modules are hidden when running management
commands
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Paul
| Schilling
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Brian Helba):

* cc: Brian Helba (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:25>

Django

unread,
Apr 22, 2026, 5:21:19 PM (9 days ago) Apr 22
to django-...@googlegroups.com
#32915: Exceptions from settings modules are hidden when running management
commands
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Brian
| Helba
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Brian Helba):

* owner: Paul Schilling => Brian Helba

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:26>

Django

unread,
Apr 22, 2026, 5:22:24 PM (9 days ago) Apr 22
to django-...@googlegroups.com
#32915: Exceptions from settings modules are hidden when running management
commands
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Brian
| Helba
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Brian Helba):

I've made https://github.com/django/django/pull/21154 , which I hope
resolves the root issue. I'm happy to respond to feedback over on the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:27>

Django

unread,
Apr 22, 2026, 5:51:26 PM (9 days ago) Apr 22
to django-...@googlegroups.com
#32915: Exceptions from settings modules are hidden when running management
commands
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: Brian
| Helba
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Brian Helba):

* needs_docs: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:28>

Django

unread,
Apr 23, 2026, 12:01:15 PM (8 days ago) Apr 23
to django-...@googlegroups.com
#32915: Exceptions from settings modules are hidden when running management
commands
-------------------------------------+-------------------------------------
Reporter: Michael | Owner: bcail
Type: Bug | Status: assigned
Component: Core (Management | Version: 3.2
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* owner: Brian Helba => bcail

Comment:

[https://github.com/django/django/pull/21157 bcail's PR with review
feedback applied]
--
Ticket URL: <https://code.djangoproject.com/ticket/32915#comment:29>
Reply all
Reply to author
Forward
0 new messages