wger: ACTUALLY enable Redis
This commit is contained in:
parent
51bb437838
commit
3121b57181
2 changed files with 11 additions and 7 deletions
|
@ -13,8 +13,8 @@ let
|
||||||
ALLOW_REGISTRATION = true;
|
ALLOW_REGISTRATION = true;
|
||||||
ALLOW_GUEST_USERS = true;
|
ALLOW_GUEST_USERS = true;
|
||||||
ALLOW_UPLOAD_VIDEOS = false;
|
ALLOW_UPLOAD_VIDEOS = false;
|
||||||
MIN_ACCOUNT_AGE_TO_TRUST = 21;
|
MIN_ACCOUNT_AGE_TO_TRUST = 1;
|
||||||
EXERCISE_CACHE_TTL = 3600;
|
EXERCISE_CACHE_TTL = 3600; # 1 hour
|
||||||
};
|
};
|
||||||
|
|
||||||
django_settings = rec {
|
django_settings = rec {
|
||||||
|
@ -54,10 +54,12 @@ let
|
||||||
EMAIL_PAGE_DOMAIN = SITE_URL;
|
EMAIL_PAGE_DOMAIN = SITE_URL;
|
||||||
|
|
||||||
# Cache - Redis
|
# Cache - Redis
|
||||||
DJANGO_CACHE_BACKEND = "django_redis.cache.RedisCache";
|
CACHES.default = {
|
||||||
DJANGO_CACHE_LOCATION = "${config.services.redis.servers.wger.unixSocket}";
|
BACKEND = "django_redis.cache.RedisCache";
|
||||||
DJANGO_CACHE_TIMEOUT = 1296000; # in seconds - 60*60*24*15, 15 Days
|
LOCATION = "unix://${config.services.redis.servers.wger.unixSocket}";
|
||||||
DJANGO_CACHE_CLIENT_CLASS = "django_redis.client.DefaultClient";
|
TIMEOUT = 15 * 24 * 60 * 60; # 15 days
|
||||||
|
OPTIONS.CLIENT_CLASS = "django_redis.client.DefaultClient";
|
||||||
|
};
|
||||||
|
|
||||||
# setup allowed hosts
|
# setup allowed hosts
|
||||||
CSRF_TRUSTED_ORIGINS = [ "https://${svc_domain}" ];
|
CSRF_TRUSTED_ORIGINS = [ "https://${svc_domain}" ];
|
||||||
|
@ -172,7 +174,7 @@ in {
|
||||||
services.redis.servers.wger = {
|
services.redis.servers.wger = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = wger_user;
|
user = wger_user;
|
||||||
appendOnly = true;
|
# appendOnly = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# setup users
|
# setup users
|
||||||
|
|
|
@ -72,6 +72,8 @@ in python3.pkgs.buildPythonPackage rec {
|
||||||
tzdata
|
tzdata
|
||||||
|
|
||||||
# extra??
|
# extra??
|
||||||
|
redis
|
||||||
|
django-redis
|
||||||
drf-spectacular-sidecar
|
drf-spectacular-sidecar
|
||||||
(python3.pkgs.callPackage ./django-bootstrap-breadcrumbs.nix {})
|
(python3.pkgs.callPackage ./django-bootstrap-breadcrumbs.nix {})
|
||||||
psycopg2
|
psycopg2
|
||||||
|
|
Loading…
Reference in a new issue