X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3596cf9db6eabb5f0aa36afe7919bc40e8ff0b9a..4cc06fc092836d96eb52ac12c691f1baa41f04b3:/src/wolnelektury/settings/basic.py diff --git a/src/wolnelektury/settings/basic.py b/src/wolnelektury/settings/basic.py index 413adbe7c..869a78dfb 100644 --- a/src/wolnelektury/settings/basic.py +++ b/src/wolnelektury/settings/basic.py @@ -1,8 +1,7 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# 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' -CACHE_MIDDLEWARE_SECONDS = 24 * 60 * 60 +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'), } } @@ -50,7 +68,6 @@ TEMPLATES = [{ 'django.template.context_processors.media', 'django.template.context_processors.request', 'wolnelektury.context_processors.extra_settings', - 'search.context_processors.search_form', ), }, }]