[Django] #36504: Docs: LazyObject for storages with override_settings does not behave as described

16 views
Skip to first unread message

Django

unread,
Jul 13, 2025, 11:36:30 AMJul 13
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
-------------------------------------+-------------------------------------
Reporter: Brinky5678 | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Dear Django Team,

While working on my own Django project using storages, I found an error in
the [Managing Files - Using a
callable](https://docs.djangoproject.com/en/5.2/topics/files/#using-a-callable)
documentation (the last two code blocks to be precise). As it turns out,
the solution of using the `override_settings` decorator does not work as
advertised while testing `FileField`s.

I have made a minimal Django project
(https://github.com/Brinky5678/django_incorrect_docs_demo) for easy
replication. In the readme, I have included steps to how to replicate, as
well as the cause of why I think it does not work as expected.

This ticket is not meant to provide a workable solution using the
`override_settings` decorator. Instead, I merely wish to have the
documentation updated in such a way that the warning of the storage
callables being evaluated during model loading remains, but without the
incorrect documentation about using `LazyObject`s.
--
Ticket URL: <https://code.djangoproject.com/ticket/36504>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 13, 2025, 1:25:04 PMJul 13
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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 Clifford Gama):

* stage: Unreviewed => Accepted

Comment:

Thanks for the report and the test project. I confirmed using the test
project that the documented example doesn't work. For reference, the
section was added by #36269.
--
Ticket URL: <https://code.djangoproject.com/ticket/36504#comment:1>

Django

unread,
Aug 11, 2025, 4:48:24 PMAug 11
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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
--------------------------------------+------------------------------------
Comment (by khosro_o):

I'm working on this ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/36504#comment:2>

Django

unread,
Aug 22, 2025, 12:41:28 PMAug 22
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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 Clifford Gama):

* has_patch: 0 => 1

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

Django

unread,
Aug 22, 2025, 12:41:45 PMAug 22
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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 Clifford Gama):

* needs_better_patch: 0 => 1

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

Django

unread,
Sep 3, 2025, 6:31:02 PM (4 days ago) Sep 3
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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 khosro_o):

* needs_better_patch: 1 => 0

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

Django

unread,
Sep 4, 2025, 5:13:08 PM (3 days ago) Sep 4
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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 Clifford Gama):

* needs_better_patch: 0 => 1

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

Django

unread,
Sep 5, 2025, 7:58:01 AM (3 days ago) Sep 5
to django-...@googlegroups.com
#36504: Docs: LazyObject for storages with override_settings does not behave as
described
--------------------------------------+------------------------------------
Reporter: Dennis Brinkman | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 5.2
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 khosro_o):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36504#comment:7>
Reply all
Reply to author
Forward
0 new messages