We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add caching
As of #278 some settings reside in the database, so we should defintely cache database requests.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ephios/settings.py`
Content:
```
1 import copy
2 import os
3 from email.utils import getaddresses
4 from importlib import metadata
5 
6 import environ
7 from django.contrib.messages import constants
8 
9 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
10 
11 env = environ.Env()
12 # for syntax see https://django-environ.readthedocs.io/en/latest/
13 environ.Env.read_env(env_file=os.path.join(BASE_DIR, ".env"))
14 
15 DATA_DIR = env.str("DATA_DIR", default=os.path.join(BASE_DIR, "data"))
16 if not os.path.exists(DATA_DIR):
17     os.mkdir(DATA_DIR)
18 
19 SECRET_KEY = env.str("SECRET_KEY")
20 DEBUG = env.bool("DEBUG")
21 ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")
22 SITE_URL = env.str("SITE_URL")
23 if SITE_URL.endswith("/"):
24     SITE_URL = SITE_URL[:-1]
25 
26 if not DEBUG:
27     SESSION_COOKIE_SECURE = True
28     CSRF_COOKIE_SECURE = True
29     X_FRAME_OPTIONS = "DENY"
30     SECURE_CONTENT_TYPE_NOSNIFF = True
31     SECURE_BROWSER_XSS_FILTER = True
32     SECURE_SSL_REDIRECT = True
33     SECURE_HSTS_SECONDS = 3600
34     SECURE_HSTS_INCLUDE_SUBDOMAINS = True
35     SECURE_REFERRER_POLICY = "same-origin"
36 
37 # Application definition
38 
39 INSTALLED_APPS = [
40     "django.contrib.admin",
41     "django.contrib.auth",
42     "polymorphic",
43     "django.contrib.contenttypes",
44     "django.contrib.sessions",
45     "django.contrib.messages",
46     "django.contrib.staticfiles",
47     "guardian",
48     "django_select2",
49     "djangoformsetjs",
50     "compressor",
51     "recurrence",
52     "statici18n",
53     "dynamic_preferences.users.apps.UserPreferencesConfig",
54     "crispy_forms",
55 ]
56 
57 EPHIOS_CORE_MODULES = [
58     "ephios.core",
59     "ephios.extra",
60 ]
61 INSTALLED_APPS += EPHIOS_CORE_MODULES
62 
63 CORE_PLUGINS = [
64     "ephios.plugins.basesignup",
65     "ephios.plugins.pages",
66     "ephios.plugins.guests",
67 ]
68 PLUGINS = copy.copy(CORE_PLUGINS)
69 for ep in metadata.entry_points().get("ephios.plugins", []):
70     PLUGINS.append(ep.module)
71 
72 INSTALLED_APPS += PLUGINS
73 
74 INSTALLED_APPS += ["dynamic_preferences"]  # must come after our apps to collect preferences
75 
76 MIDDLEWARE = [
77     "django.middleware.security.SecurityMiddleware",
78     "django.contrib.sessions.middleware.SessionMiddleware",
79     "django.middleware.common.CommonMiddleware",
80     "django.middleware.csrf.CsrfViewMiddleware",
81     "django.contrib.auth.middleware.AuthenticationMiddleware",
82     "django.contrib.messages.middleware.MessageMiddleware",
83     "django.middleware.clickjacking.XFrameOptionsMiddleware",
84     "csp.middleware.CSPMiddleware",
85 ]
86 
87 ROOT_URLCONF = "ephios.urls"
88 
89 TEMPLATES = [
90     {
91         "BACKEND": "django.template.backends.django.DjangoTemplates",
92         "DIRS": [os.path.join(BASE_DIR, "ephios/templates")],
93         "APP_DIRS": True,
94         "OPTIONS": {
95             "context_processors": [
96                 "django.template.context_processors.debug",
97                 "django.template.context_processors.request",
98                 "django.contrib.auth.context_processors.auth",
99                 "django.contrib.messages.context_processors.messages",
100                 "django.template.context_processors.i18n",
101                 "dynamic_preferences.processors.global_preferences",
102                 "ephios.core.context.ephios_base_context",
103             ],
104         },
105     },
106 ]
107 
108 LOCALE_PATHS = (os.path.join(BASE_DIR, "ephios/locale"),)
109 
110 WSGI_APPLICATION = "ephios.wsgi.application"
111 
112 # Database
113 # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
114 
115 DATABASES = {"default": env.db_url()}
116 
117 # Password validation
118 # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
119 
120 AUTH_PASSWORD_VALIDATORS = [
121     {
122         "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
123     },
124     {
125         "NAME": "ephios.core.utils.CustomMinimumLengthValidator",
126     },
127     {
128         "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
129     },
130     {
131         "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
132     },
133 ]
134 
135 AUTHENTICATION_BACKENDS = (
136     "django.contrib.auth.backends.ModelBackend",
137     "guardian.backends.ObjectPermissionBackend",
138 )
139 
140 AUTH_USER_MODEL = "core.UserProfile"
141 LOGIN_REDIRECT_URL = "/"
142 PASSWORD_RESET_TIMEOUT = 28 * 24 * 60 * 60  # seconds
143 
144 # Internationalization
145 # https://docs.djangoproject.com/en/3.0/topics/i18n/
146 
147 LANGUAGE_CODE = "de"
148 
149 TIME_ZONE = "Europe/Berlin"
150 
151 USE_I18N = True
152 
153 USE_L10N = True
154 
155 USE_TZ = True
156 
157 # Static files (CSS, JavaScript, Images)
158 # https://docs.djangoproject.com/en/3.0/howto/static-files/
159 
160 STATIC_URL = env.str("STATIC_URL")
161 STATIC_ROOT = env.str("STATIC_ROOT")
162 STATICFILES_DIRS = (os.path.join(BASE_DIR, "ephios/static"),)
163 STATICFILES_FINDERS = (
164     "django.contrib.staticfiles.finders.FileSystemFinder",
165     "django.contrib.staticfiles.finders.AppDirectoriesFinder",
166     "compressor.finders.CompressorFinder",
167 )
168 COMPRESS_ENABLED = not DEBUG
169 
170 # mail configuration
171 EMAIL_CONFIG = env.email_url("EMAIL_URL")
172 vars().update(EMAIL_CONFIG)
173 DEFAULT_FROM_EMAIL = env.str("DEFAULT_FROM_EMAIL")
174 SERVER_EMAIL = env.str("SERVER_EMAIL")
175 ADMINS = getaddresses([env("ADMINS")])
176 
177 # Guardian configuration
178 ANONYMOUS_USER_NAME = None
179 GUARDIAN_MONKEY_PATCH = False
180 
181 # django-select2
182 # Prevent django-select from loading the select2 resources as we want to serve them locally
183 SELECT2_JS = ""
184 SELECT2_CSS = ""
185 SELECT2_I18N_PATH = ""
186 
187 # django-debug-toolbar
188 if DEBUG:
189     INSTALLED_APPS.append("django_extensions")
190     INSTALLED_APPS.append("debug_toolbar")
191     MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")
192     INTERNAL_IPS = env.str("INTERNAL_IPS")
193 
194 # django-csp
195 # Bootstrap requires embedded SVG files loaded via a data URI. This is not ideal, but will only be fixed in
196 # bootstrap v5 or v6. See https://github.com/twbs/bootstrap/issues/25394 for details on the problem and
197 # https://security.stackexchange.com/a/167244 on why allowing data: is considered okay
198 CSP_IMG_SRC = ("'self'", "data:")
199 
200 # django-crispy-forms
201 CRISPY_TEMPLATE_PACK = "bootstrap4"
202 
203 # django.contrib.messages
204 MESSAGE_TAGS = {
205     constants.DEBUG: "alert-info",
206     constants.INFO: "alert-info",
207     constants.SUCCESS: "alert-success",
208     constants.WARNING: "alert-warning",
209     constants.ERROR: "alert-danger",
210 }
211 
212 # PWA
213 PWA_APP_ICONS = [
214     {"src": "/static/ephios/img/ephios-192x.png", "sizes": "192x192", "purpose": "any maskable"},
215     {"src": "/static/ephios/img/ephios-512x.png", "sizes": "512x512", "purpose": "any maskable"},
216     {"src": "/static/ephios/img/ephios-1024x.png", "sizes": "1024x1024", "purpose": "any maskable"},
217 ]
218
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ephios/settings.py b/ephios/settings.py
--- a/ephios/settings.py
+++ b/ephios/settings.py
@@ -114,6 +114,12 @@
 
 DATABASES = {"default": env.db_url()}
 
+# Caches
+CACHES = {"default": env.cache_url(default="locmemcache://")}
+SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
+DJANGO_REDIS_IGNORE_EXCEPTIONS = True
+DJANGO_REDIS_LOG_IGNORED_EXCEPTIONS = True
+
 # Password validation
 # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

{"golden_diff": "diff --git a/ephios/settings.py b/ephios/settings.py\n--- a/ephios/settings.py\n+++ b/ephios/settings.py\n@@ -114,6 +114,12 @@\n \n DATABASES = {\"default\": env.db_url()}\n \n+# Caches\n+CACHES = {\"default\": env.cache_url(default=\"locmemcache://\")}\n+SESSION_ENGINE = \"django.contrib.sessions.backends.cached_db\"\n+DJANGO_REDIS_IGNORE_EXCEPTIONS = True\n+DJANGO_REDIS_LOG_IGNORED_EXCEPTIONS = True\n+\n # Password validation\n # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators\n", "issue": "Add caching\nAs of #278 some settings reside in the database, so we should defintely cache database requests.\n", "before_files": [{"content": "import copy\nimport os\nfrom email.utils import getaddresses\nfrom importlib import metadata\n\nimport environ\nfrom django.contrib.messages import constants\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\nenv = environ.Env()\n# for syntax see https://django-environ.readthedocs.io/en/latest/\nenviron.Env.read_env(env_file=os.path.join(BASE_DIR, \".env\"))\n\nDATA_DIR = env.str(\"DATA_DIR\", default=os.path.join(BASE_DIR, \"data\"))\nif not os.path.exists(DATA_DIR):\n    os.mkdir(DATA_DIR)\n\nSECRET_KEY = env.str(\"SECRET_KEY\")\nDEBUG = env.bool(\"DEBUG\")\nALLOWED_HOSTS = env.list(\"ALLOWED_HOSTS\")\nSITE_URL = env.str(\"SITE_URL\")\nif SITE_URL.endswith(\"/\"):\n    SITE_URL = SITE_URL[:-1]\n\nif not DEBUG:\n    SESSION_COOKIE_SECURE = True\n    CSRF_COOKIE_SECURE = True\n    X_FRAME_OPTIONS = \"DENY\"\n    SECURE_CONTENT_TYPE_NOSNIFF = True\n    SECURE_BROWSER_XSS_FILTER = True\n    SECURE_SSL_REDIRECT = True\n    SECURE_HSTS_SECONDS = 3600\n    SECURE_HSTS_INCLUDE_SUBDOMAINS = True\n    SECURE_REFERRER_POLICY = \"same-origin\"\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"polymorphic\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"django.contrib.staticfiles\",\n    \"guardian\",\n    \"django_select2\",\n    \"djangoformsetjs\",\n    \"compressor\",\n    \"recurrence\",\n    \"statici18n\",\n    \"dynamic_preferences.users.apps.UserPreferencesConfig\",\n    \"crispy_forms\",\n]\n\nEPHIOS_CORE_MODULES = [\n    \"ephios.core\",\n    \"ephios.extra\",\n]\nINSTALLED_APPS += EPHIOS_CORE_MODULES\n\nCORE_PLUGINS = [\n    \"ephios.plugins.basesignup\",\n    \"ephios.plugins.pages\",\n    \"ephios.plugins.guests\",\n]\nPLUGINS = copy.copy(CORE_PLUGINS)\nfor ep in metadata.entry_points().get(\"ephios.plugins\", []):\n    PLUGINS.append(ep.module)\n\nINSTALLED_APPS += PLUGINS\n\nINSTALLED_APPS += [\"dynamic_preferences\"]  # must come after our apps to collect preferences\n\nMIDDLEWARE = [\n    \"django.middleware.security.SecurityMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n    \"csp.middleware.CSPMiddleware\",\n]\n\nROOT_URLCONF = \"ephios.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [os.path.join(BASE_DIR, \"ephios/templates\")],\n        \"APP_DIRS\": True,\n        \"OPTIONS\": {\n            \"context_processors\": [\n                \"django.template.context_processors.debug\",\n                \"django.template.context_processors.request\",\n                \"django.contrib.auth.context_processors.auth\",\n                \"django.contrib.messages.context_processors.messages\",\n                \"django.template.context_processors.i18n\",\n                \"dynamic_preferences.processors.global_preferences\",\n                \"ephios.core.context.ephios_base_context\",\n            ],\n        },\n    },\n]\n\nLOCALE_PATHS = (os.path.join(BASE_DIR, \"ephios/locale\"),)\n\nWSGI_APPLICATION = \"ephios.wsgi.application\"\n\n# Database\n# https://docs.djangoproject.com/en/3.0/ref/settings/#databases\n\nDATABASES = {\"default\": env.db_url()}\n\n# Password validation\n# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\",\n    },\n    {\n        \"NAME\": \"ephios.core.utils.CustomMinimumLengthValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.CommonPasswordValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.NumericPasswordValidator\",\n    },\n]\n\nAUTHENTICATION_BACKENDS = (\n    \"django.contrib.auth.backends.ModelBackend\",\n    \"guardian.backends.ObjectPermissionBackend\",\n)\n\nAUTH_USER_MODEL = \"core.UserProfile\"\nLOGIN_REDIRECT_URL = \"/\"\nPASSWORD_RESET_TIMEOUT = 28 * 24 * 60 * 60  # seconds\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.0/topics/i18n/\n\nLANGUAGE_CODE = \"de\"\n\nTIME_ZONE = \"Europe/Berlin\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.0/howto/static-files/\n\nSTATIC_URL = env.str(\"STATIC_URL\")\nSTATIC_ROOT = env.str(\"STATIC_ROOT\")\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, \"ephios/static\"),)\nSTATICFILES_FINDERS = (\n    \"django.contrib.staticfiles.finders.FileSystemFinder\",\n    \"django.contrib.staticfiles.finders.AppDirectoriesFinder\",\n    \"compressor.finders.CompressorFinder\",\n)\nCOMPRESS_ENABLED = not DEBUG\n\n# mail configuration\nEMAIL_CONFIG = env.email_url(\"EMAIL_URL\")\nvars().update(EMAIL_CONFIG)\nDEFAULT_FROM_EMAIL = env.str(\"DEFAULT_FROM_EMAIL\")\nSERVER_EMAIL = env.str(\"SERVER_EMAIL\")\nADMINS = getaddresses([env(\"ADMINS\")])\n\n# Guardian configuration\nANONYMOUS_USER_NAME = None\nGUARDIAN_MONKEY_PATCH = False\n\n# django-select2\n# Prevent django-select from loading the select2 resources as we want to serve them locally\nSELECT2_JS = \"\"\nSELECT2_CSS = \"\"\nSELECT2_I18N_PATH = \"\"\n\n# django-debug-toolbar\nif DEBUG:\n    INSTALLED_APPS.append(\"django_extensions\")\n    INSTALLED_APPS.append(\"debug_toolbar\")\n    MIDDLEWARE.insert(0, \"debug_toolbar.middleware.DebugToolbarMiddleware\")\n    INTERNAL_IPS = env.str(\"INTERNAL_IPS\")\n\n# django-csp\n# Bootstrap requires embedded SVG files loaded via a data URI. This is not ideal, but will only be fixed in\n# bootstrap v5 or v6. See https://github.com/twbs/bootstrap/issues/25394 for details on the problem and\n# https://security.stackexchange.com/a/167244 on why allowing data: is considered okay\nCSP_IMG_SRC = (\"'self'\", \"data:\")\n\n# django-crispy-forms\nCRISPY_TEMPLATE_PACK = \"bootstrap4\"\n\n# django.contrib.messages\nMESSAGE_TAGS = {\n    constants.DEBUG: \"alert-info\",\n    constants.INFO: \"alert-info\",\n    constants.SUCCESS: \"alert-success\",\n    constants.WARNING: \"alert-warning\",\n    constants.ERROR: \"alert-danger\",\n}\n\n# PWA\nPWA_APP_ICONS = [\n    {\"src\": \"/static/ephios/img/ephios-192x.png\", \"sizes\": \"192x192\", \"purpose\": \"any maskable\"},\n    {\"src\": \"/static/ephios/img/ephios-512x.png\", \"sizes\": \"512x512\", \"purpose\": \"any maskable\"},\n    {\"src\": \"/static/ephios/img/ephios-1024x.png\", \"sizes\": \"1024x1024\", \"purpose\": \"any maskable\"},\n]\n", "path": "ephios/settings.py"}], "after_files": [{"content": "import copy\nimport os\nfrom email.utils import getaddresses\nfrom importlib import metadata\n\nimport environ\nfrom django.contrib.messages import constants\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n\nenv = environ.Env()\n# for syntax see https://django-environ.readthedocs.io/en/latest/\nenviron.Env.read_env(env_file=os.path.join(BASE_DIR, \".env\"))\n\nDATA_DIR = env.str(\"DATA_DIR\", default=os.path.join(BASE_DIR, \"data\"))\nif not os.path.exists(DATA_DIR):\n    os.mkdir(DATA_DIR)\n\nSECRET_KEY = env.str(\"SECRET_KEY\")\nDEBUG = env.bool(\"DEBUG\")\nALLOWED_HOSTS = env.list(\"ALLOWED_HOSTS\")\nSITE_URL = env.str(\"SITE_URL\")\nif SITE_URL.endswith(\"/\"):\n    SITE_URL = SITE_URL[:-1]\n\nif not DEBUG:\n    SESSION_COOKIE_SECURE = True\n    CSRF_COOKIE_SECURE = True\n    X_FRAME_OPTIONS = \"DENY\"\n    SECURE_CONTENT_TYPE_NOSNIFF = True\n    SECURE_BROWSER_XSS_FILTER = True\n    SECURE_SSL_REDIRECT = True\n    SECURE_HSTS_SECONDS = 3600\n    SECURE_HSTS_INCLUDE_SUBDOMAINS = True\n    SECURE_REFERRER_POLICY = \"same-origin\"\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"polymorphic\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"django.contrib.staticfiles\",\n    \"guardian\",\n    \"django_select2\",\n    \"djangoformsetjs\",\n    \"compressor\",\n    \"recurrence\",\n    \"statici18n\",\n    \"dynamic_preferences.users.apps.UserPreferencesConfig\",\n    \"crispy_forms\",\n]\n\nEPHIOS_CORE_MODULES = [\n    \"ephios.core\",\n    \"ephios.extra\",\n]\nINSTALLED_APPS += EPHIOS_CORE_MODULES\n\nCORE_PLUGINS = [\n    \"ephios.plugins.basesignup\",\n    \"ephios.plugins.pages\",\n    \"ephios.plugins.guests\",\n]\nPLUGINS = copy.copy(CORE_PLUGINS)\nfor ep in metadata.entry_points().get(\"ephios.plugins\", []):\n    PLUGINS.append(ep.module)\n\nINSTALLED_APPS += PLUGINS\n\nINSTALLED_APPS += [\"dynamic_preferences\"]  # must come after our apps to collect preferences\n\nMIDDLEWARE = [\n    \"django.middleware.security.SecurityMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n    \"csp.middleware.CSPMiddleware\",\n]\n\nROOT_URLCONF = \"ephios.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [os.path.join(BASE_DIR, \"ephios/templates\")],\n        \"APP_DIRS\": True,\n        \"OPTIONS\": {\n            \"context_processors\": [\n                \"django.template.context_processors.debug\",\n                \"django.template.context_processors.request\",\n                \"django.contrib.auth.context_processors.auth\",\n                \"django.contrib.messages.context_processors.messages\",\n                \"django.template.context_processors.i18n\",\n                \"dynamic_preferences.processors.global_preferences\",\n                \"ephios.core.context.ephios_base_context\",\n            ],\n        },\n    },\n]\n\nLOCALE_PATHS = (os.path.join(BASE_DIR, \"ephios/locale\"),)\n\nWSGI_APPLICATION = \"ephios.wsgi.application\"\n\n# Database\n# https://docs.djangoproject.com/en/3.0/ref/settings/#databases\n\nDATABASES = {\"default\": env.db_url()}\n\n# Caches\nCACHES = {\"default\": env.cache_url(default=\"locmemcache://\")}\nSESSION_ENGINE = \"django.contrib.sessions.backends.cached_db\"\nDJANGO_REDIS_IGNORE_EXCEPTIONS = True\nDJANGO_REDIS_LOG_IGNORED_EXCEPTIONS = True\n\n# Password validation\n# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators\n\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\",\n    },\n    {\n        \"NAME\": \"ephios.core.utils.CustomMinimumLengthValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.CommonPasswordValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.NumericPasswordValidator\",\n    },\n]\n\nAUTHENTICATION_BACKENDS = (\n    \"django.contrib.auth.backends.ModelBackend\",\n    \"guardian.backends.ObjectPermissionBackend\",\n)\n\nAUTH_USER_MODEL = \"core.UserProfile\"\nLOGIN_REDIRECT_URL = \"/\"\nPASSWORD_RESET_TIMEOUT = 28 * 24 * 60 * 60  # seconds\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.0/topics/i18n/\n\nLANGUAGE_CODE = \"de\"\n\nTIME_ZONE = \"Europe/Berlin\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.0/howto/static-files/\n\nSTATIC_URL = env.str(\"STATIC_URL\")\nSTATIC_ROOT = env.str(\"STATIC_ROOT\")\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, \"ephios/static\"),)\nSTATICFILES_FINDERS = (\n    \"django.contrib.staticfiles.finders.FileSystemFinder\",\n    \"django.contrib.staticfiles.finders.AppDirectoriesFinder\",\n    \"compressor.finders.CompressorFinder\",\n)\nCOMPRESS_ENABLED = not DEBUG\n\n# mail configuration\nEMAIL_CONFIG = env.email_url(\"EMAIL_URL\")\nvars().update(EMAIL_CONFIG)\nDEFAULT_FROM_EMAIL = env.str(\"DEFAULT_FROM_EMAIL\")\nSERVER_EMAIL = env.str(\"SERVER_EMAIL\")\nADMINS = getaddresses([env(\"ADMINS\")])\n\n# Guardian configuration\nANONYMOUS_USER_NAME = None\nGUARDIAN_MONKEY_PATCH = False\n\n# django-select2\n# Prevent django-select from loading the select2 resources as we want to serve them locally\nSELECT2_JS = \"\"\nSELECT2_CSS = \"\"\nSELECT2_I18N_PATH = \"\"\n\n# django-debug-toolbar\nif DEBUG:\n    INSTALLED_APPS.append(\"django_extensions\")\n    INSTALLED_APPS.append(\"debug_toolbar\")\n    MIDDLEWARE.insert(0, \"debug_toolbar.middleware.DebugToolbarMiddleware\")\n    INTERNAL_IPS = env.str(\"INTERNAL_IPS\")\n\n# django-csp\n# Bootstrap requires embedded SVG files loaded via a data URI. This is not ideal, but will only be fixed in\n# bootstrap v5 or v6. See https://github.com/twbs/bootstrap/issues/25394 for details on the problem and\n# https://security.stackexchange.com/a/167244 on why allowing data: is considered okay\nCSP_IMG_SRC = (\"'self'\", \"data:\")\n\n# django-crispy-forms\nCRISPY_TEMPLATE_PACK = \"bootstrap4\"\n\n# django.contrib.messages\nMESSAGE_TAGS = {\n    constants.DEBUG: \"alert-info\",\n    constants.INFO: \"alert-info\",\n    constants.SUCCESS: \"alert-success\",\n    constants.WARNING: \"alert-warning\",\n    constants.ERROR: \"alert-danger\",\n}\n\n# PWA\nPWA_APP_ICONS = [\n    {\"src\": \"/static/ephios/img/ephios-192x.png\", \"sizes\": \"192x192\", \"purpose\": \"any maskable\"},\n    {\"src\": \"/static/ephios/img/ephios-512x.png\", \"sizes\": \"512x512\", \"purpose\": \"any maskable\"},\n    {\"src\": \"/static/ephios/img/ephios-1024x.png\", \"sizes\": \"1024x1024\", \"purpose\": \"any maskable\"},\n]\n", "path": "ephios/settings.py"}]}