Conversation
adamchainz
left a comment
There was a problem hiding this comment.
Okay, I like the idea of adding an error message. This doesn't seem like the right approach to me though. whitenoise/base.py is completely generic for use with any WSGI app. So nothing Django related can occur in that file.
If you can come up with an approach that is either generic or restricted to the Django related files, that would be good. Please also add test coverage, and a changelog note (and possibly documentation if necessary e.g. to note caveats).
|
Aha. I didn't know that. I will rethink this. |
for more information, see https://pre-commit.ci
|
I've redone this so it applies to django only. I couldn't really understand how I'd do it in a more generic way. There are now tests, and a changelog entry. Not sure what you want from the docs? It doesn't seem like it's a thing that needs documentation per se. |
Hi,
I help beginners a lot on the Unofficial Django Discord, and a very common problem is various problems with static files. I always ask them to install whitenoise obviously, but then I realized that whitenoise doesn't have great error messages for when they have other problems than just "set DEBUG=False" :P
This patch will make the error message much more informative and should help beginners a lot when trying to figure out why their static files don't work.
(This is sort of related to my other work with
django-fastdevbut this specific change made more sense in whitenoise I thought)