We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Unread notifications are no longer visually distinguished from read ones
I just forgot to consider this when I re-wrote the notifications page

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bookwyrm/settings.py`
Content:
```
1 """ bookwyrm settings and configuration """
2 import os
3 from environs import Env
4 
5 import requests
6 from django.utils.translation import gettext_lazy as _
7 
8 
9 env = Env()
10 env.read_env()
11 DOMAIN = env("DOMAIN")
12 VERSION = "0.1.1"
13 
14 PAGE_LENGTH = env("PAGE_LENGTH", 15)
15 DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
16 
17 JS_CACHE = "2d3181e1"
18 
19 # email
20 EMAIL_BACKEND = env("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend")
21 EMAIL_HOST = env("EMAIL_HOST")
22 EMAIL_PORT = env("EMAIL_PORT", 587)
23 EMAIL_HOST_USER = env("EMAIL_HOST_USER")
24 EMAIL_HOST_PASSWORD = env("EMAIL_HOST_PASSWORD")
25 EMAIL_USE_TLS = env.bool("EMAIL_USE_TLS", True)
26 EMAIL_USE_SSL = env.bool("EMAIL_USE_SSL", False)
27 EMAIL_SENDER_NAME = env("EMAIL_SENDER_NAME", "admin")
28 EMAIL_SENDER_DOMAIN = env("EMAIL_SENDER_NAME", DOMAIN)
29 EMAIL_SENDER = f"{EMAIL_SENDER_NAME}@{EMAIL_SENDER_DOMAIN}"
30 
31 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
32 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
33 LOCALE_PATHS = [
34     os.path.join(BASE_DIR, "locale"),
35 ]
36 LANGUAGE_COOKIE_NAME = env.str("LANGUAGE_COOKIE_NAME", "django_language")
37 
38 DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
39 
40 # Preview image
41 ENABLE_PREVIEW_IMAGES = env.bool("ENABLE_PREVIEW_IMAGES", False)
42 PREVIEW_BG_COLOR = env.str("PREVIEW_BG_COLOR", "use_dominant_color_light")
43 PREVIEW_TEXT_COLOR = env.str("PREVIEW_TEXT_COLOR", "#363636")
44 PREVIEW_IMG_WIDTH = env.int("PREVIEW_IMG_WIDTH", 1200)
45 PREVIEW_IMG_HEIGHT = env.int("PREVIEW_IMG_HEIGHT", 630)
46 PREVIEW_DEFAULT_COVER_COLOR = env.str("PREVIEW_DEFAULT_COVER_COLOR", "#002549")
47 
48 # Quick-start development settings - unsuitable for production
49 # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
50 
51 # SECURITY WARNING: keep the secret key used in production secret!
52 SECRET_KEY = env("SECRET_KEY")
53 
54 # SECURITY WARNING: don't run with debug turned on in production!
55 DEBUG = env.bool("DEBUG", True)
56 USE_HTTPS = env.bool("USE_HTTPS", False)
57 
58 ALLOWED_HOSTS = env.list("ALLOWED_HOSTS", ["*"])
59 
60 # Application definition
61 
62 INSTALLED_APPS = [
63     "django.contrib.admin",
64     "django.contrib.auth",
65     "django.contrib.contenttypes",
66     "django.contrib.sessions",
67     "django.contrib.messages",
68     "django.contrib.staticfiles",
69     "django.contrib.humanize",
70     "django_rename_app",
71     "bookwyrm",
72     "celery",
73     "imagekit",
74     "storages",
75 ]
76 
77 MIDDLEWARE = [
78     "django.middleware.security.SecurityMiddleware",
79     "django.contrib.sessions.middleware.SessionMiddleware",
80     "django.middleware.locale.LocaleMiddleware",
81     "django.middleware.common.CommonMiddleware",
82     "django.middleware.csrf.CsrfViewMiddleware",
83     "django.contrib.auth.middleware.AuthenticationMiddleware",
84     "bookwyrm.middleware.TimezoneMiddleware",
85     "bookwyrm.middleware.IPBlocklistMiddleware",
86     "django.contrib.messages.middleware.MessageMiddleware",
87     "django.middleware.clickjacking.XFrameOptionsMiddleware",
88 ]
89 
90 ROOT_URLCONF = "bookwyrm.urls"
91 
92 TEMPLATES = [
93     {
94         "BACKEND": "django.template.backends.django.DjangoTemplates",
95         "DIRS": ["templates"],
96         "APP_DIRS": True,
97         "OPTIONS": {
98             "context_processors": [
99                 "django.template.context_processors.debug",
100                 "django.template.context_processors.request",
101                 "django.contrib.auth.context_processors.auth",
102                 "django.contrib.messages.context_processors.messages",
103                 "bookwyrm.context_processors.site_settings",
104             ],
105         },
106     },
107 ]
108 
109 
110 WSGI_APPLICATION = "bookwyrm.wsgi.application"
111 
112 # redis/activity streams settings
113 REDIS_ACTIVITY_HOST = env("REDIS_ACTIVITY_HOST", "localhost")
114 REDIS_ACTIVITY_PORT = env("REDIS_ACTIVITY_PORT", 6379)
115 REDIS_ACTIVITY_PASSWORD = env("REDIS_ACTIVITY_PASSWORD", None)
116 
117 MAX_STREAM_LENGTH = int(env("MAX_STREAM_LENGTH", 200))
118 
119 STREAMS = [
120     {"key": "home", "name": _("Home Timeline"), "shortname": _("Home")},
121     {"key": "books", "name": _("Books Timeline"), "shortname": _("Books")},
122 ]
123 
124 # Search configuration
125 # total time in seconds that the instance will spend searching connectors
126 SEARCH_TIMEOUT = int(env("SEARCH_TIMEOUT", 15))
127 # timeout for a query to an individual connector
128 QUERY_TIMEOUT = int(env("QUERY_TIMEOUT", 5))
129 
130 # Redis cache backend
131 if env("USE_DUMMY_CACHE", False):
132     CACHES = {
133         "default": {
134             "BACKEND": "django.core.cache.backends.dummy.DummyCache",
135         }
136     }
137 else:
138     # pylint: disable=line-too-long
139     CACHES = {
140         "default": {
141             "BACKEND": "django_redis.cache.RedisCache",
142             "LOCATION": f"redis://:{REDIS_ACTIVITY_PASSWORD}@{REDIS_ACTIVITY_HOST}:{REDIS_ACTIVITY_PORT}/0",
143             "OPTIONS": {
144                 "CLIENT_CLASS": "django_redis.client.DefaultClient",
145             },
146         }
147     }
148 
149     SESSION_ENGINE = "django.contrib.sessions.backends.cache"
150     SESSION_CACHE_ALIAS = "default"
151 
152 # Database
153 # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
154 
155 DATABASES = {
156     "default": {
157         "ENGINE": "django.db.backends.postgresql_psycopg2",
158         "NAME": env("POSTGRES_DB", "bookwyrm"),
159         "USER": env("POSTGRES_USER", "bookwyrm"),
160         "PASSWORD": env("POSTGRES_PASSWORD", "bookwyrm"),
161         "HOST": env("POSTGRES_HOST", ""),
162         "PORT": env("PGPORT", 5432),
163     },
164 }
165 
166 
167 LOGIN_URL = "/login/"
168 AUTH_USER_MODEL = "bookwyrm.User"
169 
170 # Password validation
171 # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
172 
173 # pylint: disable=line-too-long
174 AUTH_PASSWORD_VALIDATORS = [
175     {
176         "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
177     },
178     {
179         "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
180     },
181     {
182         "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
183     },
184     {
185         "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
186     },
187 ]
188 
189 
190 # Internationalization
191 # https://docs.djangoproject.com/en/3.2/topics/i18n/
192 
193 LANGUAGE_CODE = "en-us"
194 LANGUAGES = [
195     ("en-us", _("English")),
196     ("de-de", _("Deutsch (German)")),
197     ("es-es", _("Español (Spanish)")),
198     ("gl-es", _("Galego (Galician)")),
199     ("it-it", _("Italiano (Italian)")),
200     ("fr-fr", _("Français (French)")),
201     ("lt-lt", _("Lietuvių (Lithuanian)")),
202     ("no-no", _("Norsk (Norwegian)")),
203     ("pt-br", _("Português do Brasil (Brazilian Portuguese)")),
204     ("pt-pt", _("Português Europeu (European Portuguese)")),
205     ("zh-hans", _("简体中文 (Simplified Chinese)")),
206     ("zh-hant", _("繁體中文 (Traditional Chinese)")),
207 ]
208 
209 
210 TIME_ZONE = "UTC"
211 
212 USE_I18N = True
213 
214 USE_L10N = True
215 
216 USE_TZ = True
217 
218 
219 agent = requests.utils.default_user_agent()
220 USER_AGENT = f"{agent} (BookWyrm/{VERSION}; +https://{DOMAIN}/)"
221 
222 # Imagekit generated thumbnails
223 ENABLE_THUMBNAIL_GENERATION = env.bool("ENABLE_THUMBNAIL_GENERATION", False)
224 IMAGEKIT_CACHEFILE_DIR = "thumbnails"
225 IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY = "bookwyrm.thumbnail_generation.Strategy"
226 
227 # Static files (CSS, JavaScript, Images)
228 # https://docs.djangoproject.com/en/3.2/howto/static-files/
229 
230 PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
231 
232 # Storage
233 
234 PROTOCOL = "http"
235 if USE_HTTPS:
236     PROTOCOL = "https"
237 
238 USE_S3 = env.bool("USE_S3", False)
239 
240 if USE_S3:
241     # AWS settings
242     AWS_ACCESS_KEY_ID = env("AWS_ACCESS_KEY_ID")
243     AWS_SECRET_ACCESS_KEY = env("AWS_SECRET_ACCESS_KEY")
244     AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME")
245     AWS_S3_CUSTOM_DOMAIN = env("AWS_S3_CUSTOM_DOMAIN")
246     AWS_S3_REGION_NAME = env("AWS_S3_REGION_NAME", "")
247     AWS_S3_ENDPOINT_URL = env("AWS_S3_ENDPOINT_URL")
248     AWS_DEFAULT_ACL = "public-read"
249     AWS_S3_OBJECT_PARAMETERS = {"CacheControl": "max-age=86400"}
250     # S3 Static settings
251     STATIC_LOCATION = "static"
252     STATIC_URL = f"{PROTOCOL}://{AWS_S3_CUSTOM_DOMAIN}/{STATIC_LOCATION}/"
253     STATICFILES_STORAGE = "bookwyrm.storage_backends.StaticStorage"
254     # S3 Media settings
255     MEDIA_LOCATION = "images"
256     MEDIA_URL = f"{PROTOCOL}://{AWS_S3_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/"
257     MEDIA_FULL_URL = MEDIA_URL
258     STATIC_FULL_URL = STATIC_URL
259     DEFAULT_FILE_STORAGE = "bookwyrm.storage_backends.ImagesStorage"
260     # I don't know if it's used, but the site crashes without it
261     STATIC_ROOT = os.path.join(BASE_DIR, env("STATIC_ROOT", "static"))
262     MEDIA_ROOT = os.path.join(BASE_DIR, env("MEDIA_ROOT", "images"))
263 else:
264     STATIC_URL = "/static/"
265     STATIC_ROOT = os.path.join(BASE_DIR, env("STATIC_ROOT", "static"))
266     MEDIA_URL = "/images/"
267     MEDIA_FULL_URL = f"{PROTOCOL}://{DOMAIN}{MEDIA_URL}"
268     STATIC_FULL_URL = f"{PROTOCOL}://{DOMAIN}{STATIC_URL}"
269     MEDIA_ROOT = os.path.join(BASE_DIR, env("MEDIA_ROOT", "images"))
270
```
--- 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/bookwyrm/settings.py b/bookwyrm/settings.py
--- a/bookwyrm/settings.py
+++ b/bookwyrm/settings.py
@@ -14,7 +14,7 @@
 PAGE_LENGTH = env("PAGE_LENGTH", 15)
 DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
 
-JS_CACHE = "2d3181e1"
+JS_CACHE = "9b4cc1f7"
 
 # email
 EMAIL_BACKEND = env("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend")

{"golden_diff": "diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py\n--- a/bookwyrm/settings.py\n+++ b/bookwyrm/settings.py\n@@ -14,7 +14,7 @@\n PAGE_LENGTH = env(\"PAGE_LENGTH\", 15)\n DEFAULT_LANGUAGE = env(\"DEFAULT_LANGUAGE\", \"English\")\n \n-JS_CACHE = \"2d3181e1\"\n+JS_CACHE = \"9b4cc1f7\"\n \n # email\n EMAIL_BACKEND = env(\"EMAIL_BACKEND\", \"django.core.mail.backends.smtp.EmailBackend\")\n", "issue": "Unread notifications are no longer visually distinguished from read ones\nI just forgot to consider this when I re-wrote the notifications page\n", "before_files": [{"content": "\"\"\" bookwyrm settings and configuration \"\"\"\nimport os\nfrom environs import Env\n\nimport requests\nfrom django.utils.translation import gettext_lazy as _\n\n\nenv = Env()\nenv.read_env()\nDOMAIN = env(\"DOMAIN\")\nVERSION = \"0.1.1\"\n\nPAGE_LENGTH = env(\"PAGE_LENGTH\", 15)\nDEFAULT_LANGUAGE = env(\"DEFAULT_LANGUAGE\", \"English\")\n\nJS_CACHE = \"2d3181e1\"\n\n# email\nEMAIL_BACKEND = env(\"EMAIL_BACKEND\", \"django.core.mail.backends.smtp.EmailBackend\")\nEMAIL_HOST = env(\"EMAIL_HOST\")\nEMAIL_PORT = env(\"EMAIL_PORT\", 587)\nEMAIL_HOST_USER = env(\"EMAIL_HOST_USER\")\nEMAIL_HOST_PASSWORD = env(\"EMAIL_HOST_PASSWORD\")\nEMAIL_USE_TLS = env.bool(\"EMAIL_USE_TLS\", True)\nEMAIL_USE_SSL = env.bool(\"EMAIL_USE_SSL\", False)\nEMAIL_SENDER_NAME = env(\"EMAIL_SENDER_NAME\", \"admin\")\nEMAIL_SENDER_DOMAIN = env(\"EMAIL_SENDER_NAME\", DOMAIN)\nEMAIL_SENDER = f\"{EMAIL_SENDER_NAME}@{EMAIL_SENDER_DOMAIN}\"\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nLOCALE_PATHS = [\n    os.path.join(BASE_DIR, \"locale\"),\n]\nLANGUAGE_COOKIE_NAME = env.str(\"LANGUAGE_COOKIE_NAME\", \"django_language\")\n\nDEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n\n# Preview image\nENABLE_PREVIEW_IMAGES = env.bool(\"ENABLE_PREVIEW_IMAGES\", False)\nPREVIEW_BG_COLOR = env.str(\"PREVIEW_BG_COLOR\", \"use_dominant_color_light\")\nPREVIEW_TEXT_COLOR = env.str(\"PREVIEW_TEXT_COLOR\", \"#363636\")\nPREVIEW_IMG_WIDTH = env.int(\"PREVIEW_IMG_WIDTH\", 1200)\nPREVIEW_IMG_HEIGHT = env.int(\"PREVIEW_IMG_HEIGHT\", 630)\nPREVIEW_DEFAULT_COVER_COLOR = env.str(\"PREVIEW_DEFAULT_COVER_COLOR\", \"#002549\")\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = env(\"SECRET_KEY\")\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = env.bool(\"DEBUG\", True)\nUSE_HTTPS = env.bool(\"USE_HTTPS\", False)\n\nALLOWED_HOSTS = env.list(\"ALLOWED_HOSTS\", [\"*\"])\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"django.contrib.staticfiles\",\n    \"django.contrib.humanize\",\n    \"django_rename_app\",\n    \"bookwyrm\",\n    \"celery\",\n    \"imagekit\",\n    \"storages\",\n]\n\nMIDDLEWARE = [\n    \"django.middleware.security.SecurityMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"django.middleware.locale.LocaleMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"bookwyrm.middleware.TimezoneMiddleware\",\n    \"bookwyrm.middleware.IPBlocklistMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n]\n\nROOT_URLCONF = \"bookwyrm.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [\"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                \"bookwyrm.context_processors.site_settings\",\n            ],\n        },\n    },\n]\n\n\nWSGI_APPLICATION = \"bookwyrm.wsgi.application\"\n\n# redis/activity streams settings\nREDIS_ACTIVITY_HOST = env(\"REDIS_ACTIVITY_HOST\", \"localhost\")\nREDIS_ACTIVITY_PORT = env(\"REDIS_ACTIVITY_PORT\", 6379)\nREDIS_ACTIVITY_PASSWORD = env(\"REDIS_ACTIVITY_PASSWORD\", None)\n\nMAX_STREAM_LENGTH = int(env(\"MAX_STREAM_LENGTH\", 200))\n\nSTREAMS = [\n    {\"key\": \"home\", \"name\": _(\"Home Timeline\"), \"shortname\": _(\"Home\")},\n    {\"key\": \"books\", \"name\": _(\"Books Timeline\"), \"shortname\": _(\"Books\")},\n]\n\n# Search configuration\n# total time in seconds that the instance will spend searching connectors\nSEARCH_TIMEOUT = int(env(\"SEARCH_TIMEOUT\", 15))\n# timeout for a query to an individual connector\nQUERY_TIMEOUT = int(env(\"QUERY_TIMEOUT\", 5))\n\n# Redis cache backend\nif env(\"USE_DUMMY_CACHE\", False):\n    CACHES = {\n        \"default\": {\n            \"BACKEND\": \"django.core.cache.backends.dummy.DummyCache\",\n        }\n    }\nelse:\n    # pylint: disable=line-too-long\n    CACHES = {\n        \"default\": {\n            \"BACKEND\": \"django_redis.cache.RedisCache\",\n            \"LOCATION\": f\"redis://:{REDIS_ACTIVITY_PASSWORD}@{REDIS_ACTIVITY_HOST}:{REDIS_ACTIVITY_PORT}/0\",\n            \"OPTIONS\": {\n                \"CLIENT_CLASS\": \"django_redis.client.DefaultClient\",\n            },\n        }\n    }\n\n    SESSION_ENGINE = \"django.contrib.sessions.backends.cache\"\n    SESSION_CACHE_ALIAS = \"default\"\n\n# Database\n# https://docs.djangoproject.com/en/3.2/ref/settings/#databases\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.postgresql_psycopg2\",\n        \"NAME\": env(\"POSTGRES_DB\", \"bookwyrm\"),\n        \"USER\": env(\"POSTGRES_USER\", \"bookwyrm\"),\n        \"PASSWORD\": env(\"POSTGRES_PASSWORD\", \"bookwyrm\"),\n        \"HOST\": env(\"POSTGRES_HOST\", \"\"),\n        \"PORT\": env(\"PGPORT\", 5432),\n    },\n}\n\n\nLOGIN_URL = \"/login/\"\nAUTH_USER_MODEL = \"bookwyrm.User\"\n\n# Password validation\n# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators\n\n# pylint: disable=line-too-long\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.MinimumLengthValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.CommonPasswordValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.NumericPasswordValidator\",\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.2/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\nLANGUAGES = [\n    (\"en-us\", _(\"English\")),\n    (\"de-de\", _(\"Deutsch (German)\")),\n    (\"es-es\", _(\"Espa\u00f1ol (Spanish)\")),\n    (\"gl-es\", _(\"Galego (Galician)\")),\n    (\"it-it\", _(\"Italiano (Italian)\")),\n    (\"fr-fr\", _(\"Fran\u00e7ais (French)\")),\n    (\"lt-lt\", _(\"Lietuvi\u0173 (Lithuanian)\")),\n    (\"no-no\", _(\"Norsk (Norwegian)\")),\n    (\"pt-br\", _(\"Portugu\u00eas do Brasil (Brazilian Portuguese)\")),\n    (\"pt-pt\", _(\"Portugu\u00eas Europeu (European Portuguese)\")),\n    (\"zh-hans\", _(\"\u7b80\u4f53\u4e2d\u6587 (Simplified Chinese)\")),\n    (\"zh-hant\", _(\"\u7e41\u9ad4\u4e2d\u6587 (Traditional Chinese)\")),\n]\n\n\nTIME_ZONE = \"UTC\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\nagent = requests.utils.default_user_agent()\nUSER_AGENT = f\"{agent} (BookWyrm/{VERSION}; +https://{DOMAIN}/)\"\n\n# Imagekit generated thumbnails\nENABLE_THUMBNAIL_GENERATION = env.bool(\"ENABLE_THUMBNAIL_GENERATION\", False)\nIMAGEKIT_CACHEFILE_DIR = \"thumbnails\"\nIMAGEKIT_DEFAULT_CACHEFILE_STRATEGY = \"bookwyrm.thumbnail_generation.Strategy\"\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.2/howto/static-files/\n\nPROJECT_DIR = os.path.dirname(os.path.abspath(__file__))\n\n# Storage\n\nPROTOCOL = \"http\"\nif USE_HTTPS:\n    PROTOCOL = \"https\"\n\nUSE_S3 = env.bool(\"USE_S3\", False)\n\nif USE_S3:\n    # AWS settings\n    AWS_ACCESS_KEY_ID = env(\"AWS_ACCESS_KEY_ID\")\n    AWS_SECRET_ACCESS_KEY = env(\"AWS_SECRET_ACCESS_KEY\")\n    AWS_STORAGE_BUCKET_NAME = env(\"AWS_STORAGE_BUCKET_NAME\")\n    AWS_S3_CUSTOM_DOMAIN = env(\"AWS_S3_CUSTOM_DOMAIN\")\n    AWS_S3_REGION_NAME = env(\"AWS_S3_REGION_NAME\", \"\")\n    AWS_S3_ENDPOINT_URL = env(\"AWS_S3_ENDPOINT_URL\")\n    AWS_DEFAULT_ACL = \"public-read\"\n    AWS_S3_OBJECT_PARAMETERS = {\"CacheControl\": \"max-age=86400\"}\n    # S3 Static settings\n    STATIC_LOCATION = \"static\"\n    STATIC_URL = f\"{PROTOCOL}://{AWS_S3_CUSTOM_DOMAIN}/{STATIC_LOCATION}/\"\n    STATICFILES_STORAGE = \"bookwyrm.storage_backends.StaticStorage\"\n    # S3 Media settings\n    MEDIA_LOCATION = \"images\"\n    MEDIA_URL = f\"{PROTOCOL}://{AWS_S3_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/\"\n    MEDIA_FULL_URL = MEDIA_URL\n    STATIC_FULL_URL = STATIC_URL\n    DEFAULT_FILE_STORAGE = \"bookwyrm.storage_backends.ImagesStorage\"\n    # I don't know if it's used, but the site crashes without it\n    STATIC_ROOT = os.path.join(BASE_DIR, env(\"STATIC_ROOT\", \"static\"))\n    MEDIA_ROOT = os.path.join(BASE_DIR, env(\"MEDIA_ROOT\", \"images\"))\nelse:\n    STATIC_URL = \"/static/\"\n    STATIC_ROOT = os.path.join(BASE_DIR, env(\"STATIC_ROOT\", \"static\"))\n    MEDIA_URL = \"/images/\"\n    MEDIA_FULL_URL = f\"{PROTOCOL}://{DOMAIN}{MEDIA_URL}\"\n    STATIC_FULL_URL = f\"{PROTOCOL}://{DOMAIN}{STATIC_URL}\"\n    MEDIA_ROOT = os.path.join(BASE_DIR, env(\"MEDIA_ROOT\", \"images\"))\n", "path": "bookwyrm/settings.py"}], "after_files": [{"content": "\"\"\" bookwyrm settings and configuration \"\"\"\nimport os\nfrom environs import Env\n\nimport requests\nfrom django.utils.translation import gettext_lazy as _\n\n\nenv = Env()\nenv.read_env()\nDOMAIN = env(\"DOMAIN\")\nVERSION = \"0.1.1\"\n\nPAGE_LENGTH = env(\"PAGE_LENGTH\", 15)\nDEFAULT_LANGUAGE = env(\"DEFAULT_LANGUAGE\", \"English\")\n\nJS_CACHE = \"9b4cc1f7\"\n\n# email\nEMAIL_BACKEND = env(\"EMAIL_BACKEND\", \"django.core.mail.backends.smtp.EmailBackend\")\nEMAIL_HOST = env(\"EMAIL_HOST\")\nEMAIL_PORT = env(\"EMAIL_PORT\", 587)\nEMAIL_HOST_USER = env(\"EMAIL_HOST_USER\")\nEMAIL_HOST_PASSWORD = env(\"EMAIL_HOST_PASSWORD\")\nEMAIL_USE_TLS = env.bool(\"EMAIL_USE_TLS\", True)\nEMAIL_USE_SSL = env.bool(\"EMAIL_USE_SSL\", False)\nEMAIL_SENDER_NAME = env(\"EMAIL_SENDER_NAME\", \"admin\")\nEMAIL_SENDER_DOMAIN = env(\"EMAIL_SENDER_NAME\", DOMAIN)\nEMAIL_SENDER = f\"{EMAIL_SENDER_NAME}@{EMAIL_SENDER_DOMAIN}\"\n\n# Build paths inside the project like this: os.path.join(BASE_DIR, ...)\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nLOCALE_PATHS = [\n    os.path.join(BASE_DIR, \"locale\"),\n]\nLANGUAGE_COOKIE_NAME = env.str(\"LANGUAGE_COOKIE_NAME\", \"django_language\")\n\nDEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n\n# Preview image\nENABLE_PREVIEW_IMAGES = env.bool(\"ENABLE_PREVIEW_IMAGES\", False)\nPREVIEW_BG_COLOR = env.str(\"PREVIEW_BG_COLOR\", \"use_dominant_color_light\")\nPREVIEW_TEXT_COLOR = env.str(\"PREVIEW_TEXT_COLOR\", \"#363636\")\nPREVIEW_IMG_WIDTH = env.int(\"PREVIEW_IMG_WIDTH\", 1200)\nPREVIEW_IMG_HEIGHT = env.int(\"PREVIEW_IMG_HEIGHT\", 630)\nPREVIEW_DEFAULT_COVER_COLOR = env.str(\"PREVIEW_DEFAULT_COVER_COLOR\", \"#002549\")\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = env(\"SECRET_KEY\")\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = env.bool(\"DEBUG\", True)\nUSE_HTTPS = env.bool(\"USE_HTTPS\", False)\n\nALLOWED_HOSTS = env.list(\"ALLOWED_HOSTS\", [\"*\"])\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"django.contrib.admin\",\n    \"django.contrib.auth\",\n    \"django.contrib.contenttypes\",\n    \"django.contrib.sessions\",\n    \"django.contrib.messages\",\n    \"django.contrib.staticfiles\",\n    \"django.contrib.humanize\",\n    \"django_rename_app\",\n    \"bookwyrm\",\n    \"celery\",\n    \"imagekit\",\n    \"storages\",\n]\n\nMIDDLEWARE = [\n    \"django.middleware.security.SecurityMiddleware\",\n    \"django.contrib.sessions.middleware.SessionMiddleware\",\n    \"django.middleware.locale.LocaleMiddleware\",\n    \"django.middleware.common.CommonMiddleware\",\n    \"django.middleware.csrf.CsrfViewMiddleware\",\n    \"django.contrib.auth.middleware.AuthenticationMiddleware\",\n    \"bookwyrm.middleware.TimezoneMiddleware\",\n    \"bookwyrm.middleware.IPBlocklistMiddleware\",\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n]\n\nROOT_URLCONF = \"bookwyrm.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [\"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                \"bookwyrm.context_processors.site_settings\",\n            ],\n        },\n    },\n]\n\n\nWSGI_APPLICATION = \"bookwyrm.wsgi.application\"\n\n# redis/activity streams settings\nREDIS_ACTIVITY_HOST = env(\"REDIS_ACTIVITY_HOST\", \"localhost\")\nREDIS_ACTIVITY_PORT = env(\"REDIS_ACTIVITY_PORT\", 6379)\nREDIS_ACTIVITY_PASSWORD = env(\"REDIS_ACTIVITY_PASSWORD\", None)\n\nMAX_STREAM_LENGTH = int(env(\"MAX_STREAM_LENGTH\", 200))\n\nSTREAMS = [\n    {\"key\": \"home\", \"name\": _(\"Home Timeline\"), \"shortname\": _(\"Home\")},\n    {\"key\": \"books\", \"name\": _(\"Books Timeline\"), \"shortname\": _(\"Books\")},\n]\n\n# Search configuration\n# total time in seconds that the instance will spend searching connectors\nSEARCH_TIMEOUT = int(env(\"SEARCH_TIMEOUT\", 15))\n# timeout for a query to an individual connector\nQUERY_TIMEOUT = int(env(\"QUERY_TIMEOUT\", 5))\n\n# Redis cache backend\nif env(\"USE_DUMMY_CACHE\", False):\n    CACHES = {\n        \"default\": {\n            \"BACKEND\": \"django.core.cache.backends.dummy.DummyCache\",\n        }\n    }\nelse:\n    # pylint: disable=line-too-long\n    CACHES = {\n        \"default\": {\n            \"BACKEND\": \"django_redis.cache.RedisCache\",\n            \"LOCATION\": f\"redis://:{REDIS_ACTIVITY_PASSWORD}@{REDIS_ACTIVITY_HOST}:{REDIS_ACTIVITY_PORT}/0\",\n            \"OPTIONS\": {\n                \"CLIENT_CLASS\": \"django_redis.client.DefaultClient\",\n            },\n        }\n    }\n\n    SESSION_ENGINE = \"django.contrib.sessions.backends.cache\"\n    SESSION_CACHE_ALIAS = \"default\"\n\n# Database\n# https://docs.djangoproject.com/en/3.2/ref/settings/#databases\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.postgresql_psycopg2\",\n        \"NAME\": env(\"POSTGRES_DB\", \"bookwyrm\"),\n        \"USER\": env(\"POSTGRES_USER\", \"bookwyrm\"),\n        \"PASSWORD\": env(\"POSTGRES_PASSWORD\", \"bookwyrm\"),\n        \"HOST\": env(\"POSTGRES_HOST\", \"\"),\n        \"PORT\": env(\"PGPORT\", 5432),\n    },\n}\n\n\nLOGIN_URL = \"/login/\"\nAUTH_USER_MODEL = \"bookwyrm.User\"\n\n# Password validation\n# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators\n\n# pylint: disable=line-too-long\nAUTH_PASSWORD_VALIDATORS = [\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.UserAttributeSimilarityValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.MinimumLengthValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.CommonPasswordValidator\",\n    },\n    {\n        \"NAME\": \"django.contrib.auth.password_validation.NumericPasswordValidator\",\n    },\n]\n\n\n# Internationalization\n# https://docs.djangoproject.com/en/3.2/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\nLANGUAGES = [\n    (\"en-us\", _(\"English\")),\n    (\"de-de\", _(\"Deutsch (German)\")),\n    (\"es-es\", _(\"Espa\u00f1ol (Spanish)\")),\n    (\"gl-es\", _(\"Galego (Galician)\")),\n    (\"it-it\", _(\"Italiano (Italian)\")),\n    (\"fr-fr\", _(\"Fran\u00e7ais (French)\")),\n    (\"lt-lt\", _(\"Lietuvi\u0173 (Lithuanian)\")),\n    (\"no-no\", _(\"Norsk (Norwegian)\")),\n    (\"pt-br\", _(\"Portugu\u00eas do Brasil (Brazilian Portuguese)\")),\n    (\"pt-pt\", _(\"Portugu\u00eas Europeu (European Portuguese)\")),\n    (\"zh-hans\", _(\"\u7b80\u4f53\u4e2d\u6587 (Simplified Chinese)\")),\n    (\"zh-hant\", _(\"\u7e41\u9ad4\u4e2d\u6587 (Traditional Chinese)\")),\n]\n\n\nTIME_ZONE = \"UTC\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\nagent = requests.utils.default_user_agent()\nUSER_AGENT = f\"{agent} (BookWyrm/{VERSION}; +https://{DOMAIN}/)\"\n\n# Imagekit generated thumbnails\nENABLE_THUMBNAIL_GENERATION = env.bool(\"ENABLE_THUMBNAIL_GENERATION\", False)\nIMAGEKIT_CACHEFILE_DIR = \"thumbnails\"\nIMAGEKIT_DEFAULT_CACHEFILE_STRATEGY = \"bookwyrm.thumbnail_generation.Strategy\"\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.2/howto/static-files/\n\nPROJECT_DIR = os.path.dirname(os.path.abspath(__file__))\n\n# Storage\n\nPROTOCOL = \"http\"\nif USE_HTTPS:\n    PROTOCOL = \"https\"\n\nUSE_S3 = env.bool(\"USE_S3\", False)\n\nif USE_S3:\n    # AWS settings\n    AWS_ACCESS_KEY_ID = env(\"AWS_ACCESS_KEY_ID\")\n    AWS_SECRET_ACCESS_KEY = env(\"AWS_SECRET_ACCESS_KEY\")\n    AWS_STORAGE_BUCKET_NAME = env(\"AWS_STORAGE_BUCKET_NAME\")\n    AWS_S3_CUSTOM_DOMAIN = env(\"AWS_S3_CUSTOM_DOMAIN\")\n    AWS_S3_REGION_NAME = env(\"AWS_S3_REGION_NAME\", \"\")\n    AWS_S3_ENDPOINT_URL = env(\"AWS_S3_ENDPOINT_URL\")\n    AWS_DEFAULT_ACL = \"public-read\"\n    AWS_S3_OBJECT_PARAMETERS = {\"CacheControl\": \"max-age=86400\"}\n    # S3 Static settings\n    STATIC_LOCATION = \"static\"\n    STATIC_URL = f\"{PROTOCOL}://{AWS_S3_CUSTOM_DOMAIN}/{STATIC_LOCATION}/\"\n    STATICFILES_STORAGE = \"bookwyrm.storage_backends.StaticStorage\"\n    # S3 Media settings\n    MEDIA_LOCATION = \"images\"\n    MEDIA_URL = f\"{PROTOCOL}://{AWS_S3_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/\"\n    MEDIA_FULL_URL = MEDIA_URL\n    STATIC_FULL_URL = STATIC_URL\n    DEFAULT_FILE_STORAGE = \"bookwyrm.storage_backends.ImagesStorage\"\n    # I don't know if it's used, but the site crashes without it\n    STATIC_ROOT = os.path.join(BASE_DIR, env(\"STATIC_ROOT\", \"static\"))\n    MEDIA_ROOT = os.path.join(BASE_DIR, env(\"MEDIA_ROOT\", \"images\"))\nelse:\n    STATIC_URL = \"/static/\"\n    STATIC_ROOT = os.path.join(BASE_DIR, env(\"STATIC_ROOT\", \"static\"))\n    MEDIA_URL = \"/images/\"\n    MEDIA_FULL_URL = f\"{PROTOCOL}://{DOMAIN}{MEDIA_URL}\"\n    STATIC_FULL_URL = f\"{PROTOCOL}://{DOMAIN}{STATIC_URL}\"\n    MEDIA_ROOT = os.path.join(BASE_DIR, env(\"MEDIA_ROOT\", \"images\"))\n", "path": "bookwyrm/settings.py"}]}