X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/18aa8ca52202003e5628a882f3469a04d905cc05..4cc06fc092836d96eb52ac12c691f1baa41f04b3:/src/wolnelektury/settings/basic.py?ds=inline diff --git a/src/wolnelektury/settings/basic.py b/src/wolnelektury/settings/basic.py index aa5073606..869a78dfb 100644 --- a/src/wolnelektury/settings/basic.py +++ b/src/wolnelektury/settings/basic.py @@ -1,8 +1,7 @@ # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # -from os import path -from .paths import PROJECT_DIR +import os DEBUG = True @@ -14,15 +13,34 @@ MANAGERS = ADMINS CONTACT_EMAIL = 'fundacja@wolnelektury.pl' +ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split() + CACHE_MIDDLEWARE_SECONDS = 3 * 60 +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'TIMEOUT': 180, + 'LOCATION': [ + 'memcached:11211', + ], + }, + 'template_fragments': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'TIMEOUT': 86400, + 'LOCATION': [ + 'memcached:11211', + ], + }, +} + DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', # 'postgresql_psycopg2' - 'NAME': path.join(PROJECT_DIR, 'dev.db'), - 'USER': '', # Not used with sqlite3. - 'PASSWORD': '', # Not used with sqlite3. - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'ENGINE': 'django.db.backends.postgresql', + 'HOST': 'db', + 'USER': os.environ.get('POSTGRES_USER'), + 'PASSWORD': os.environ.get('POSTGRES_PASSWORD'), + 'NAME': os.environ.get('POSTGRES_USER'), } }