mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #548] Debug=False causes resources not to be found #397
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#397
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @horschi on GitHub (Aug 3, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/548
Hi,
We set up our own healthchecks on Ubuntu 18.04 following the instructions in the Readme.
In Debug mode everything is working fine. But as soon as we switched debug=false, we got http 500 errors, which I think we solved by setting some missing properties and running "collectstatic" and "compress".
Now we a in a situation where it seems to basically work, but static resources are not being served (http 404 errors):
As you can see, the REST calls work fine, its only resources that are not being served! if we switch back to debug mode, then it works fine again.
Our config file looks as follows:
Our files on disk also look good to us:
We cannot think of anything else to check, so perhaps your have at least a hint for us what to check for? Or is it perhaps even some bug?
Thanks a lot in advance,
Christian and Ales :-)
@cuu508 commented on GitHub (Aug 3, 2021):
Hi Christian and Ales,
Django apps serve static files during development, but in production it is expected the static files will be served separately by a web server. See the Django docs here:
https://docs.djangoproject.com/en/3.2/howto/static-files/deployment/
Looking at the Healthchecks' README, there's no mention of serving static files, I'll look into improving the README. As a minimum, link to the above page.
If you plan to put nginx, apache, caddy or another web server in front of your Healthchecks instance, you can configure the web server to serve static files from ~/webapps/healthchecks/static-collected/.
Another option is to use whitenoise, but this requires changing settings.py. I'll look into adding whitenoise in the default configuration – it would be nice if static files worked out of the box.
@horschi commented on GitHub (Aug 3, 2021):
Yes, that was it. It was not clear that the files are not served. Thanks!
For others reading this, we use NGinx to serve and now use the following configuration:
@cuu508 commented on GitHub (Aug 5, 2021):
I plan to update README a bit, and look into using whitenoise. I'll keep this issue open until that's done so I don't forget.