[Django] #36968: Provide better error messages when collectstatic can't find a file referenced in another file

5 views
Skip to first unread message

Django

unread,
Mar 4, 2026, 4:26:27 PM (3 days ago) Mar 4
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
------------------------+------------------------------------------------
Reporter: blighj | Type: Cleanup/optimization
Status: new | Component: contrib.staticfiles
Version: 6.0 | 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
------------------------+------------------------------------------------
At present when `ManifestStaticFilesStorage` finds a reference within a
file to another file that does not exist in the static files. It throws an
error that causes confusion. For example
https://code.djangoproject.com/ticket/21080#comment:43
Whilenoise has already got a nice pattern to provide a clearer reason to
the user so they can fix the issue easily.

The {ext} file '{filename}' references a file which could not be
found:
{missing}
Please check the URL references in this {ext} file, particularly any
relative paths which might be pointing to the wrong location.
--
Ticket URL: <https://code.djangoproject.com/ticket/36968>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 4, 2026, 4:29:43 PM (3 days ago) Mar 4
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
--------------------------------------+------------------------------------
Reporter: blighj | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: 6.0
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 Jacob Walls):

* stage: Unreviewed => Accepted

Comment:

A thousand times, "yes"!
--
Ticket URL: <https://code.djangoproject.com/ticket/36968#comment:1>

Django

unread,
Mar 4, 2026, 4:42:29 PM (3 days ago) Mar 4
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
--------------------------------------+------------------------------------
Reporter: blighj | Owner: blighj
Type: Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: 6.0
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 blighj):

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

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

Django

unread,
Mar 6, 2026, 11:15:58 AM (21 hours ago) Mar 6
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
--------------------------------------+------------------------------------
Reporter: blighj | Owner: blighj
Type: Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: 6.0
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 blighj):

* has_patch: 0 => 1

Comment:

I've added a PR with the wording

{{{
'{filename}' contains a URL '{matched_url}' on line [X or contents of line
if short]

The storage resolved the url to {path/to/missing.file} and could not find
that file.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36968#comment:3>

Django

unread,
Mar 6, 2026, 2:17:00 PM (18 hours ago) Mar 6
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
--------------------------------------+------------------------------------
Reporter: blighj | Owner: blighj
Type: Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: 6.0
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 Jacob Walls):

* needs_better_patch: 0 => 1

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

Django

unread,
Mar 6, 2026, 3:51:22 PM (16 hours ago) Mar 6
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
--------------------------------------+------------------------------------
Reporter: blighj | Owner: blighj
Type: Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: 6.0
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 blighj):

* needs_better_patch: 1 => 0

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

Django

unread,
Mar 6, 2026, 4:32:25 PM (16 hours ago) Mar 6
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
-------------------------------------+-------------------------------------
Reporter: blighj | Owner: blighj
Type: | Status: assigned
Cleanup/optimization |
Component: contrib.staticfiles | Version: 6.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin

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

Django

unread,
Mar 6, 2026, 4:54:38 PM (15 hours ago) Mar 6
to django-...@googlegroups.com
#36968: Provide better error messages when collectstatic can't find a file
referenced in another file
-------------------------------------+-------------------------------------
Reporter: blighj | Owner: blighj
Type: | Status: closed
Cleanup/optimization |
Component: contrib.staticfiles | Version: 6.0
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls <jacobtylerwalls@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"864850b20f7ef89ed2f6bd8baf1a45acc9245a6c" 864850b]:
{{{#!CommitTicketReference repository=""
revision="864850b20f7ef89ed2f6bd8baf1a45acc9245a6c"
Fixed #36968 -- Improved error message when collectstatic can't find a
referenced file.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36968#comment:7>
Reply all
Reply to author
Forward
0 new messages