We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Django debug toolbar is not working
I just noticed that while working in my development environment (devcontainer setup), the Django debug toolbar doesn't show. Perhaps this was as a result of #1454? 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `django/cantusdb_project/cantusdb/settings.py`
Content:
```
1 """
2 Django settings for cantusdb project.
3 
4 Generated by 'django-admin startproject' using Django 3.0.6.
5 
6 For more information on this file, see
7 https://docs.djangoproject.com/en/3.0/topics/settings/
8 
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/3.0/ref/settings/
11 """
12 
13 import os
14 from distutils.util import strtobool
15 from django.contrib.messages import constants as messages
16 
17 # https://ordinarycoders.com/blog/article/django-messages-framework
18 MESSAGE_TAGS = {
19     messages.DEBUG: "alert-secondary",
20     messages.INFO: "alert-info",
21     messages.SUCCESS: "alert-success",
22     messages.WARNING: "alert-warning",
23     messages.ERROR: "alert-danger",
24 }
25 
26 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
27 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
28 
29 STATIC_ROOT = os.getenv("CANTUSDB_STATIC_ROOT")
30 MEDIA_ROOT = os.getenv("CANTUSDB_MEDIA_ROOT")
31 
32 # Quick-start development settings - unsuitable for production
33 # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
34 
35 # SECURITY WARNING: keep the secret key used in production secret!
36 SECRET_KEY = os.getenv("CANTUSDB_SECRET_KEY")
37 
38 PROJECT_ENVIRONMENT = os.getenv("PROJECT_ENVIRONMENT")
39 
40 # SECURITY WARNING: don't run with debug turned on in production!
41 DEBUG = False  # this is switched to True below when PROJECT_ENVIRONMENT=="DEVELOPMENT"
42 
43 ALLOWED_HOSTS = [os.getenv("CANTUSDB_HOST")]
44 CSRF_TRUSTED_ORIGINS = [f'https://{os.getenv("CANTUSDB_HOST")}']
45 if PROJECT_ENVIRONMENT == "DEVELOPMENT":
46     DEBUG = True
47 
48 # Application definition
49 
50 INSTALLED_APPS = [
51     "dal",
52     "dal_select2",
53     "django.contrib.admin",
54     "django.contrib.auth",
55     "django.contrib.contenttypes",
56     "django.contrib.sessions",
57     "django.contrib.messages",
58     "django.contrib.staticfiles",
59     "django.contrib.sites",
60     "django.contrib.flatpages",
61     "django.contrib.humanize",
62     "django.contrib.postgres",
63     "extra_views",
64     "main_app",
65     "articles",
66     "django_quill",  # to provide rich-text field for articles
67     "reversion",  # django-reversion, for version history of objects in database
68     "users",
69 ]
70 
71 MIDDLEWARE = [
72     "django.middleware.security.SecurityMiddleware",
73     "django.contrib.sessions.middleware.SessionMiddleware",
74     "django.middleware.common.CommonMiddleware",
75     "django.middleware.csrf.CsrfViewMiddleware",
76     "django.contrib.auth.middleware.AuthenticationMiddleware",
77     "django.contrib.messages.middleware.MessageMiddleware",
78     "django.middleware.clickjacking.XFrameOptionsMiddleware",
79     "django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
80     "reversion.middleware.RevisionMiddleware",
81 ]
82 
83 ROOT_URLCONF = "cantusdb.urls"
84 
85 TEMPLATES = [
86     {
87         "BACKEND": "django.template.backends.django.DjangoTemplates",
88         "DIRS": [os.path.join(BASE_DIR, "templates")],
89         "APP_DIRS": True,
90         "OPTIONS": {
91             "context_processors": [
92                 "django.template.context_processors.debug",
93                 "django.template.context_processors.request",
94                 "django.contrib.auth.context_processors.auth",
95                 "django.contrib.messages.context_processors.messages",
96                 "main_app.context_processors.determine_project_environment",
97             ],
98         },
99     },
100 ]
101 
102 TEMPLATE_LOADERS = "django.template.loaders.app_directories.load_template_source"
103 
104 WSGI_APPLICATION = "cantusdb.wsgi.application"
105 
106 
107 # Database
108 # https://docs.djangoproject.com/en/3.0/ref/settings/#databases
109 
110 DATABASES = {
111     "default": {
112         "ENGINE": "django.db.backends.postgresql",
113         "NAME": os.getenv("POSTGRES_DB"),
114         "USER": os.getenv("POSTGRES_USER"),
115         "HOST": os.getenv("POSTGRES_HOST"),
116         "PORT": os.getenv("POSTGRES_PORT"),
117         "PASSWORD": os.getenv("POSTGRES_PASSWORD"),
118     }
119 }
120 
121 
122 # Password validation
123 # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
124 
125 AUTH_PASSWORD_VALIDATORS = [
126     {
127         "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
128     },
129     {
130         "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
131     },
132     {
133         "NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
134     },
135     {
136         "NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
137     },
138 ]
139 
140 
141 # Internationalization
142 # https://docs.djangoproject.com/en/3.0/topics/i18n/
143 
144 LANGUAGE_CODE = "en-us"
145 
146 TIME_ZONE = "UTC"
147 
148 USE_I18N = True
149 
150 USE_L10N = True
151 
152 USE_TZ = True
153 
154 
155 # Static files (CSS, JavaScript, Images)
156 # https://docs.djangoproject.com/en/3.0/howto/static-files/
157 
158 STATIC_URL = "/static/"
159 
160 STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
161 
162 AUTH_USER_MODEL = "users.User"
163 LOGIN_REDIRECT_URL = "/"
164 LOGIN_URL = "/login/"
165 LOGOUT_REDIRECT_URL = "/login/"
166 
167 SITE_ID = 4
168 
169 # New in django 3.2: specify the default type of auto-created primary keys
170 # https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
171 DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
172 
173 EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
174 EMAIL_HOST = "email-smtp.us-west-2.amazonaws.com"
175 EMAIL_PORT = 587
176 EMAIL_HOST_USER = os.getenv("AWS_EMAIL_HOST_USER")
177 EMAIL_HOST_PASSWORD = os.getenv("AWS_EMAIL_HOST_PASSWORD")
178 EMAIL_USE_TLS = True
179 
180 DEFAULT_FROM_EMAIL = "noreply@cantusdatabase.simssa.ca"
181 
182 # automatically disable all panels which user can then manually enable
183 DEBUG_TOOLBAR_CONFIG = {
184     "DISABLE_PANELS": {
185         "debug_toolbar.panels.history.HistoryPanel",
186         "debug_toolbar.panels.versions.VersionsPanel",
187         "debug_toolbar.panels.timer.TimerPanel",
188         "debug_toolbar.panels.settings.SettingsPanel",
189         "debug_toolbar.panels.headers.HeadersPanel",
190         "debug_toolbar.panels.request.RequestPanel",
191         "debug_toolbar.panels.sql.SQLPanel",
192         "debug_toolbar.panels.staticfiles.StaticFilesPanel",
193         "debug_toolbar.panels.templates.TemplatesPanel",
194         "debug_toolbar.panels.cache.CachePanel",
195         "debug_toolbar.panels.signals.SignalsPanel",
196         "debug_toolbar.panels.logging.LoggingPanel",
197         "debug_toolbar.panels.redirects.RedirectsPanel",
198         "debug_toolbar.panels.profiling.ProfilingPanel",
199     },
200 }
201 
202 INTERNAL_IPS = [
203     "127.0.0.1",
204 ]
205 
206 if DEBUG:
207     INSTALLED_APPS.append("debug_toolbar")
208     # debug toolbar must be inserted as early in the middleware as possible
209     MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")
210
```
--- 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/django/cantusdb_project/cantusdb/settings.py b/django/cantusdb_project/cantusdb/settings.py
--- a/django/cantusdb_project/cantusdb/settings.py
+++ b/django/cantusdb_project/cantusdb/settings.py
@@ -197,6 +197,9 @@
         "debug_toolbar.panels.redirects.RedirectsPanel",
         "debug_toolbar.panels.profiling.ProfilingPanel",
     },
+    "SHOW_TOOLBAR_CALLBACK": lambda request: (
+        False if request.headers.get("x-requested-with") == "XMLHttpRequest" else True
+    ),
 }
 
 INTERNAL_IPS = [

{"golden_diff": "diff --git a/django/cantusdb_project/cantusdb/settings.py b/django/cantusdb_project/cantusdb/settings.py\n--- a/django/cantusdb_project/cantusdb/settings.py\n+++ b/django/cantusdb_project/cantusdb/settings.py\n@@ -197,6 +197,9 @@\n         \"debug_toolbar.panels.redirects.RedirectsPanel\",\n         \"debug_toolbar.panels.profiling.ProfilingPanel\",\n     },\n+    \"SHOW_TOOLBAR_CALLBACK\": lambda request: (\n+        False if request.headers.get(\"x-requested-with\") == \"XMLHttpRequest\" else True\n+    ),\n }\n \n INTERNAL_IPS = [\n", "issue": "Django debug toolbar is not working\nI just noticed that while working in my development environment (devcontainer setup), the Django debug toolbar doesn't show. Perhaps this was as a result of #1454? \n", "before_files": [{"content": "\"\"\"\nDjango settings for cantusdb project.\n\nGenerated by 'django-admin startproject' using Django 3.0.6.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.0/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/3.0/ref/settings/\n\"\"\"\n\nimport os\nfrom distutils.util import strtobool\nfrom django.contrib.messages import constants as messages\n\n# https://ordinarycoders.com/blog/article/django-messages-framework\nMESSAGE_TAGS = {\n    messages.DEBUG: \"alert-secondary\",\n    messages.INFO: \"alert-info\",\n    messages.SUCCESS: \"alert-success\",\n    messages.WARNING: \"alert-warning\",\n    messages.ERROR: \"alert-danger\",\n}\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__)))\n\nSTATIC_ROOT = os.getenv(\"CANTUSDB_STATIC_ROOT\")\nMEDIA_ROOT = os.getenv(\"CANTUSDB_MEDIA_ROOT\")\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = os.getenv(\"CANTUSDB_SECRET_KEY\")\n\nPROJECT_ENVIRONMENT = os.getenv(\"PROJECT_ENVIRONMENT\")\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False  # this is switched to True below when PROJECT_ENVIRONMENT==\"DEVELOPMENT\"\n\nALLOWED_HOSTS = [os.getenv(\"CANTUSDB_HOST\")]\nCSRF_TRUSTED_ORIGINS = [f'https://{os.getenv(\"CANTUSDB_HOST\")}']\nif PROJECT_ENVIRONMENT == \"DEVELOPMENT\":\n    DEBUG = True\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"dal\",\n    \"dal_select2\",\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.sites\",\n    \"django.contrib.flatpages\",\n    \"django.contrib.humanize\",\n    \"django.contrib.postgres\",\n    \"extra_views\",\n    \"main_app\",\n    \"articles\",\n    \"django_quill\",  # to provide rich-text field for articles\n    \"reversion\",  # django-reversion, for version history of objects in database\n    \"users\",\n]\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    \"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware\",\n    \"reversion.middleware.RevisionMiddleware\",\n]\n\nROOT_URLCONF = \"cantusdb.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [os.path.join(BASE_DIR, \"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                \"main_app.context_processors.determine_project_environment\",\n            ],\n        },\n    },\n]\n\nTEMPLATE_LOADERS = \"django.template.loaders.app_directories.load_template_source\"\n\nWSGI_APPLICATION = \"cantusdb.wsgi.application\"\n\n\n# Database\n# https://docs.djangoproject.com/en/3.0/ref/settings/#databases\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.postgresql\",\n        \"NAME\": os.getenv(\"POSTGRES_DB\"),\n        \"USER\": os.getenv(\"POSTGRES_USER\"),\n        \"HOST\": os.getenv(\"POSTGRES_HOST\"),\n        \"PORT\": os.getenv(\"POSTGRES_PORT\"),\n        \"PASSWORD\": os.getenv(\"POSTGRES_PASSWORD\"),\n    }\n}\n\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\": \"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.0/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\n\nTIME_ZONE = \"UTC\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.0/howto/static-files/\n\nSTATIC_URL = \"/static/\"\n\nSTATICFILES_DIRS = [os.path.join(BASE_DIR, \"static\")]\n\nAUTH_USER_MODEL = \"users.User\"\nLOGIN_REDIRECT_URL = \"/\"\nLOGIN_URL = \"/login/\"\nLOGOUT_REDIRECT_URL = \"/login/\"\n\nSITE_ID = 4\n\n# New in django 3.2: specify the default type of auto-created primary keys\n# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys\nDEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n\nEMAIL_BACKEND = \"django.core.mail.backends.smtp.EmailBackend\"\nEMAIL_HOST = \"email-smtp.us-west-2.amazonaws.com\"\nEMAIL_PORT = 587\nEMAIL_HOST_USER = os.getenv(\"AWS_EMAIL_HOST_USER\")\nEMAIL_HOST_PASSWORD = os.getenv(\"AWS_EMAIL_HOST_PASSWORD\")\nEMAIL_USE_TLS = True\n\nDEFAULT_FROM_EMAIL = \"noreply@cantusdatabase.simssa.ca\"\n\n# automatically disable all panels which user can then manually enable\nDEBUG_TOOLBAR_CONFIG = {\n    \"DISABLE_PANELS\": {\n        \"debug_toolbar.panels.history.HistoryPanel\",\n        \"debug_toolbar.panels.versions.VersionsPanel\",\n        \"debug_toolbar.panels.timer.TimerPanel\",\n        \"debug_toolbar.panels.settings.SettingsPanel\",\n        \"debug_toolbar.panels.headers.HeadersPanel\",\n        \"debug_toolbar.panels.request.RequestPanel\",\n        \"debug_toolbar.panels.sql.SQLPanel\",\n        \"debug_toolbar.panels.staticfiles.StaticFilesPanel\",\n        \"debug_toolbar.panels.templates.TemplatesPanel\",\n        \"debug_toolbar.panels.cache.CachePanel\",\n        \"debug_toolbar.panels.signals.SignalsPanel\",\n        \"debug_toolbar.panels.logging.LoggingPanel\",\n        \"debug_toolbar.panels.redirects.RedirectsPanel\",\n        \"debug_toolbar.panels.profiling.ProfilingPanel\",\n    },\n}\n\nINTERNAL_IPS = [\n    \"127.0.0.1\",\n]\n\nif DEBUG:\n    INSTALLED_APPS.append(\"debug_toolbar\")\n    # debug toolbar must be inserted as early in the middleware as possible\n    MIDDLEWARE.insert(0, \"debug_toolbar.middleware.DebugToolbarMiddleware\")\n", "path": "django/cantusdb_project/cantusdb/settings.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for cantusdb project.\n\nGenerated by 'django-admin startproject' using Django 3.0.6.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.0/topics/settings/\n\nFor the full list of settings and their values, see\nhttps://docs.djangoproject.com/en/3.0/ref/settings/\n\"\"\"\n\nimport os\nfrom distutils.util import strtobool\nfrom django.contrib.messages import constants as messages\n\n# https://ordinarycoders.com/blog/article/django-messages-framework\nMESSAGE_TAGS = {\n    messages.DEBUG: \"alert-secondary\",\n    messages.INFO: \"alert-info\",\n    messages.SUCCESS: \"alert-success\",\n    messages.WARNING: \"alert-warning\",\n    messages.ERROR: \"alert-danger\",\n}\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__)))\n\nSTATIC_ROOT = os.getenv(\"CANTUSDB_STATIC_ROOT\")\nMEDIA_ROOT = os.getenv(\"CANTUSDB_MEDIA_ROOT\")\n\n# Quick-start development settings - unsuitable for production\n# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/\n\n# SECURITY WARNING: keep the secret key used in production secret!\nSECRET_KEY = os.getenv(\"CANTUSDB_SECRET_KEY\")\n\nPROJECT_ENVIRONMENT = os.getenv(\"PROJECT_ENVIRONMENT\")\n\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = False  # this is switched to True below when PROJECT_ENVIRONMENT==\"DEVELOPMENT\"\n\nALLOWED_HOSTS = [os.getenv(\"CANTUSDB_HOST\")]\nCSRF_TRUSTED_ORIGINS = [f'https://{os.getenv(\"CANTUSDB_HOST\")}']\nif PROJECT_ENVIRONMENT == \"DEVELOPMENT\":\n    DEBUG = True\n\n# Application definition\n\nINSTALLED_APPS = [\n    \"dal\",\n    \"dal_select2\",\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.sites\",\n    \"django.contrib.flatpages\",\n    \"django.contrib.humanize\",\n    \"django.contrib.postgres\",\n    \"extra_views\",\n    \"main_app\",\n    \"articles\",\n    \"django_quill\",  # to provide rich-text field for articles\n    \"reversion\",  # django-reversion, for version history of objects in database\n    \"users\",\n]\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    \"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware\",\n    \"reversion.middleware.RevisionMiddleware\",\n]\n\nROOT_URLCONF = \"cantusdb.urls\"\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [os.path.join(BASE_DIR, \"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                \"main_app.context_processors.determine_project_environment\",\n            ],\n        },\n    },\n]\n\nTEMPLATE_LOADERS = \"django.template.loaders.app_directories.load_template_source\"\n\nWSGI_APPLICATION = \"cantusdb.wsgi.application\"\n\n\n# Database\n# https://docs.djangoproject.com/en/3.0/ref/settings/#databases\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django.db.backends.postgresql\",\n        \"NAME\": os.getenv(\"POSTGRES_DB\"),\n        \"USER\": os.getenv(\"POSTGRES_USER\"),\n        \"HOST\": os.getenv(\"POSTGRES_HOST\"),\n        \"PORT\": os.getenv(\"POSTGRES_PORT\"),\n        \"PASSWORD\": os.getenv(\"POSTGRES_PASSWORD\"),\n    }\n}\n\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\": \"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.0/topics/i18n/\n\nLANGUAGE_CODE = \"en-us\"\n\nTIME_ZONE = \"UTC\"\n\nUSE_I18N = True\n\nUSE_L10N = True\n\nUSE_TZ = True\n\n\n# Static files (CSS, JavaScript, Images)\n# https://docs.djangoproject.com/en/3.0/howto/static-files/\n\nSTATIC_URL = \"/static/\"\n\nSTATICFILES_DIRS = [os.path.join(BASE_DIR, \"static\")]\n\nAUTH_USER_MODEL = \"users.User\"\nLOGIN_REDIRECT_URL = \"/\"\nLOGIN_URL = \"/login/\"\nLOGOUT_REDIRECT_URL = \"/login/\"\n\nSITE_ID = 4\n\n# New in django 3.2: specify the default type of auto-created primary keys\n# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys\nDEFAULT_AUTO_FIELD = \"django.db.models.AutoField\"\n\nEMAIL_BACKEND = \"django.core.mail.backends.smtp.EmailBackend\"\nEMAIL_HOST = \"email-smtp.us-west-2.amazonaws.com\"\nEMAIL_PORT = 587\nEMAIL_HOST_USER = os.getenv(\"AWS_EMAIL_HOST_USER\")\nEMAIL_HOST_PASSWORD = os.getenv(\"AWS_EMAIL_HOST_PASSWORD\")\nEMAIL_USE_TLS = True\n\nDEFAULT_FROM_EMAIL = \"noreply@cantusdatabase.simssa.ca\"\n\n# automatically disable all panels which user can then manually enable\nDEBUG_TOOLBAR_CONFIG = {\n    \"DISABLE_PANELS\": {\n        \"debug_toolbar.panels.history.HistoryPanel\",\n        \"debug_toolbar.panels.versions.VersionsPanel\",\n        \"debug_toolbar.panels.timer.TimerPanel\",\n        \"debug_toolbar.panels.settings.SettingsPanel\",\n        \"debug_toolbar.panels.headers.HeadersPanel\",\n        \"debug_toolbar.panels.request.RequestPanel\",\n        \"debug_toolbar.panels.sql.SQLPanel\",\n        \"debug_toolbar.panels.staticfiles.StaticFilesPanel\",\n        \"debug_toolbar.panels.templates.TemplatesPanel\",\n        \"debug_toolbar.panels.cache.CachePanel\",\n        \"debug_toolbar.panels.signals.SignalsPanel\",\n        \"debug_toolbar.panels.logging.LoggingPanel\",\n        \"debug_toolbar.panels.redirects.RedirectsPanel\",\n        \"debug_toolbar.panels.profiling.ProfilingPanel\",\n    },\n    \"SHOW_TOOLBAR_CALLBACK\": lambda request: (\n        False if request.headers.get(\"x-requested-with\") == \"XMLHttpRequest\" else True\n    ),\n}\n\nINTERNAL_IPS = [\n    \"127.0.0.1\",\n]\n\nif DEBUG:\n    INSTALLED_APPS.append(\"debug_toolbar\")\n    # debug toolbar must be inserted as early in the middleware as possible\n    MIDDLEWARE.insert(0, \"debug_toolbar.middleware.DebugToolbarMiddleware\")\n", "path": "django/cantusdb_project/cantusdb/settings.py"}]}