I had an existing/working Django App and when I added some new views (basic pages with static information) I couldn't access these new views when DEBUG=False
The only error I can see on console when the Debug=True is: Failed to load resource: the server responded with a status of 500 ()
The rest of the app is working properly, only the new views occur this problem... I am hosting it at Namecheap Stellar Hosting.
Any idea?!
#๐ DJANGO - Server Error (500)
19 messages ยท Page 1 of 1 (latest)
@late jungle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
I also have this error but I can not find anything on my JS related to this one
when you're running debug as false, you're in production mode and django no longer handles static content for you
https://discord.com/invite/xcRH6mN4fa those people can help you more
Ik now and for that I am using whitenoise
oh ok, well ask on that server anyway, it's django focused
I will, thanks a lot
Anyone giving suggestions is welcomed
set WHITENOISE_AUTOREFRESH = True
also check png files sometimes get saved with capital letters, like PNG. Apparently that was causing a problem with whitenoise.
Thanks for your response brother!
What I did was changing the storage to django.contrib.staticfiles.storage.StaticFilesStorage
Seems like this one handles the issue when PNG's are being saved with capital
What is this doing btw?
WHITENOISE_AUTOREFRESH = True
The whitenoise.storage.CompressedManifestStaticFilesStorage class uses hashed filenames for static files and can cause issues if there are discrepancies or if the static files are not properly collected and served. By switching to django.contrib.staticfiles.storage.StaticFilesStorage"
it rechecks the file system to see if any files have changed before responding.
Alright!
Thank you!
!solved
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.