Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ docker_migrate:
docker_backend_shell:
docker compose run --rm backend bash

docker_backend_manage:
docker compose run --rm backend python manage.py $(ARG)

docker_backend_update_schema:
docker compose run --rm backend python manage.py spectacular --color --file schema.yml

Expand All @@ -57,3 +60,6 @@ docker_frontend_shell:

docker_frontend_update_api:
docker compose run --rm frontend pnpm run openapi-ts

docker_redis_clear:
docker compose exec result redis-cli FLUSHDB
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ WORKDIR /home/user/app/backend
COPY backend/ /home/user/app/backend

USER user
CMD gunicorn {{project_name}}.wsgi --log-file - -b 0.0.0.0:8000 --reload
CMD gunicorn {{project_name}}.wsgi --log-file - --access-logfile - --access-logformat '%(t)s %(h)s "%(r)s" %(s)s %(b)s %(L)ss' -b 0.0.0.0:8000 --reload
10 changes: 9 additions & 1 deletion backend/project_name/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,21 @@ def base_dir_join(*args):
"SERVE_INCLUDE_SCHEMA": False,
}

CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": config("REDIS_URL", default="redis://result:6379/1"),
}
}

SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"

USE_I18N = True


USE_TZ = True

STATICFILES_DIRS = (base_dir_join("../frontend", "webpack_bundles"),)
Expand Down
8 changes: 8 additions & 0 deletions backend/project_name/settings/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@
# Celery
CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_EAGER_PROPAGATES = True

# Use in-memory cache for tests
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "test-cache",
}
}
Loading