diff --git a/api/settings.py b/api/settings.py index 9f021c3..a4d3c52 100644 --- a/api/settings.py +++ b/api/settings.py @@ -105,10 +105,19 @@ PROD_DATABASES = { }, } +PROD_CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.db.DatabaseCache", + "LOCATION": "webpreview_api_cache", + } +} + if DEBUG: DATABASES = DEV_DATABASES else: DATABASES = PROD_DATABASES + SESSION_ENGINE = "django.contrib.sessions.backends.cache" + CACHES = PROD_CACHES # Password validation # https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators diff --git a/entrypoint.sh b/entrypoint.sh index 2c7f6c3..0232825 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/sh +python manage.py createcachetable python manage.py migrate --noinput -exec gunicorn --bind 0.0.0.0:8000 api.wsgi:application -w 5 \ No newline at end of file +exec gunicorn --bind 0.0.0.0:8000 api.asgi:application -k uvicorn.workers.UvicornWorker -w 5 \ No newline at end of file