Skip to content

Docs should include creating cache table #14

@bellisk

Description

@bellisk

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

  1. Set up Ourchive instance as described in Getting Started docs, with OURCHIVE_DEBUG=True in .env
  2. Edit .env to have OURCHIVE_DEBUG=False
  3. Restart server or restart gunicorn, if using that
  4. Get error page when accessing Ourchive in browser
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions