[Django] #31528: collectstatic management command ignores all system checks, including its own?

27 views
Skip to first unread message

Django

unread,
May 1, 2020, 6:30:42 AM5/1/20
to django-...@googlegroups.com
#31528: collectstatic management command ignores all system checks, including its
own?
-----------------------------------------------+------------------------
Reporter: Keryn Knight | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: master
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 |
-----------------------------------------------+------------------------
Piecing this together from a user who is having trouble with staticfiles
(who doesn't, at least once) on IRC.

the system checks framework has a `check_finders` which is invoked if
`django.contrib.staticfiles` is in your `INSTALLED_APPS` which defers
checks to each individually configured finder as `finder.check()` - this
accounts for running the following line:
{{{
if not isinstance(settings.STATICFILES_DIRS, (list, tuple)):
}}}
which is intended to catch the problem scenario of `STATICFILES_DIRS = ()`
being edited to `STATICFILES_DIRS = ("mypath")` with no trailing comma to
make it a tuple, rather than an iterable string.

However, the collectstatic management command has `requires_system_checks
= False` so it appears possible to edit the value and directly run `python
manage.py collectstatic` without the type being checked or the error
raised.

Naively, I'm assuming that something like the following needs to occur:
{{{
for finder in get_finders():
finder.check() # ignoring NotImplementedError
# then somehow surface any errors back to stderr as if
`requires_system_checks = True`
}}}
I've not delved deeply into the "surface errors" part.

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

Django

unread,
May 4, 2020, 1:01:12 AM5/4/20
to django-...@googlegroups.com
#31528: collectstatic doesn't run staticfiles checks.
-------------------------------------+------------------------------------

Reporter: Keryn Knight | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: master
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 felixxm):

* stage: Unreviewed => Accepted


Comment:

We should be able to run only `staticfiles` checks with
`self.check(app_configs)` or by using `Tags`, `self.check(tags=[...])`.

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

Django

unread,
May 6, 2020, 4:28:30 PM5/6/20
to django-...@googlegroups.com
#31528: collectstatic doesn't run staticfiles checks.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: master

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 Hasan Ramezani):

* owner: nobody => Hasan Ramezani
* status: new => assigned


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

Django

unread,
May 6, 2020, 4:48:51 PM5/6/20
to django-...@googlegroups.com
#31528: collectstatic doesn't run staticfiles checks.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: master

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 Hasan Ramezani):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/12869 PR]

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

Django

unread,
May 8, 2020, 1:58:19 PM5/8/20
to django-...@googlegroups.com
#31528: collectstatic doesn't run staticfiles checks.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner: Hasan
| Ramezani
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution: fixed
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 Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"87faeee4e0c0eb3937e2e575794f4512e513d214" 87faeee4]:
{{{
#!CommitTicketReference repository=""
revision="87faeee4e0c0eb3937e2e575794f4512e513d214"
Fixed #31528 -- Made collectstatic management command run staticfiles
checks.
}}}

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

Reply all
Reply to author
Forward
0 new messages