-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description
I have a newly installed instance of Ourchive and was working on it at the weekend with OURCHIVE_DEBUG=True. When I set debug to False and restarted Gunicorn, I got a 502 Bad Gateway error and saw the following in the logs:
django.db.utils.ProgrammingError: relation "ourchive_database_cache" does not exist
I found in the code that when debug is True, the app uses a dummy cache, but when debug is False it uses the Django database cache. When I created the cache table with python manage.py createcachetable and restarted Gunicorn again, everything was OK.
I think this step should be mentioned in the Getting Started docs. (Sorry for not providing a PR for this - it's been a while since I was working actively with Django and I'm not 100% sure the cache table would not be created with the steps that are already mentioned, if I'd started out with OURCHIVE_DEBUG=False, but I don't think it would.)
Steps to reproduce
- Set up Ourchive instance as described in Getting Started docs, with
OURCHIVE_DEBUG=Truein.env - Edit
.envto haveOURCHIVE_DEBUG=False - Restart server or restart gunicorn, if using that
- Get error page when accessing Ourchive in browser
- See the following error in the logs:
django.db.utils.ProgrammingError: relation "ourchive_database_cache" does not exist
Expected result
The site should work in non-debug mode.
Actual result
The site does not load in non-debug mode.
Environment
Digital Ocean hosting, Ubuntu 22.04, Python 3.10.12.