X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/4cc06fc092836d96eb52ac12c691f1baa41f04b3..e6239f4e83a99503be4c09c329029df1d3f2b5b9:/src/wolnelektury/settings/basic.py diff --git a/src/wolnelektury/settings/basic.py b/src/wolnelektury/settings/basic.py index 869a78dfb..fe048e4bb 100644 --- a/src/wolnelektury/settings/basic.py +++ b/src/wolnelektury/settings/basic.py @@ -3,7 +3,8 @@ # import os -DEBUG = True +DEBUG = os.environ.get('DEBUG', '') +SECRET_KEY = os.environ.get('SECRET_KEY', None) ADMINS = [ # ('Your Name', 'your_email@domain.com'), @@ -15,22 +16,52 @@ CONTACT_EMAIL = 'fundacja@wolnelektury.pl' ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split() +AUTH_PASSWORD_VALIDATORS = [ + { + "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator", + "OPTIONS": { + "min_length": 6, + }, + }, + { + "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator", + }, + { + "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator", + }, +] + CACHE_MIDDLEWARE_SECONDS = 3 * 60 CACHES = { 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'TIMEOUT': 180, 'LOCATION': [ 'memcached:11211', ], + 'OPTIONS': { + "no_delay": True, + "ignore_exc": True, # treat memcached errors as cache misses + "max_pool_size": 4, + "use_pooling": True, + }, }, 'template_fragments': { - 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'BACKEND': 'django.core.cache.backends.memcached.PyMemcacheCache', 'TIMEOUT': 86400, 'LOCATION': [ 'memcached:11211', ], + 'OPTIONS': { + "no_delay": True, + "ignore_exc": True, # treat memcached errors as cache misses + "max_pool_size": 4, + "use_pooling": True, + }, }, }