-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nice 404 error message #366
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-fastdev
but this specific change made more sense in whitenoise I thought)