We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove Sentry as a barrier to development
Our project currently will not start without configuring a SENTRY_ADDRESS. In general, development should be as quick and painless as possible -- and not be inhibited by production concerns.

For the time being, since we are not in production, remove the dependency on Sentry.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `project/civiwiki/settings.py`
Content:
```
1 """
2 Django settings for civiwiki project.
3 Darius Calliet May 12, 2016
4 
5 Production settings file to select proper environment variables.
6 """
7 import os
8 import sentry_sdk
9 import environ
10 
11 from django.core.exceptions import ImproperlyConfigured
12 
13 from sentry_sdk.integrations.django import DjangoIntegration
14 
15 env = environ.Env(
16     # set casting, default value
17     DEBUG=(bool, False)
18 )
19 # reading .env file
20 environ.Env.read_env()
21 
22 # False if not in os.environ
23 DEBUG = env("DEBUG")
24 
25 if not DEBUG:
26     SENTRY_ADDRESS = env("SENTRY_ADDRESS")
27     if SENTRY_ADDRESS:
28         sentry_sdk.init(dsn=SENTRY_ADDRESS, integrations=[DjangoIntegration()])
29 
30 DJANGO_HOST = env("DJANGO_HOST", default="LOCALHOST")
31 
32 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
33 SECRET_KEY = env("DJANGO_SECRET_KEY", default="TEST_KEY_FOR_DEVELOPMENT")
34 ALLOWED_HOSTS = [".herokuapp.com", ".civiwiki.org", "127.0.0.1", "localhost", "0.0.0.0"]
35 
36 INSTALLED_APPS = (
37     "django.contrib.admin",
38     "django.contrib.auth",
39     "django.contrib.contenttypes",
40     "django.contrib.sessions",
41     "django.contrib.messages",
42     "django.contrib.staticfiles",
43     "django_extensions",
44     "storages",
45     "channels",
46     "civiwiki",
47     "api",
48     "rest_framework",
49     "authentication",
50     "frontend_views",
51     "notifications",
52     "corsheaders",
53 )
54 
55 MIDDLEWARE = [
56     "corsheaders.middleware.CorsMiddleware",
57     "django.middleware.security.SecurityMiddleware",
58     "whitenoise.middleware.WhiteNoiseMiddleware",
59     "django.contrib.sessions.middleware.SessionMiddleware",
60     "django.middleware.common.CommonMiddleware",
61     "django.middleware.csrf.CsrfViewMiddleware",
62     "django.contrib.auth.middleware.AuthenticationMiddleware",
63     # 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
64     "django.contrib.messages.middleware.MessageMiddleware",
65     "django.middleware.clickjacking.XFrameOptionsMiddleware",
66 ]
67 
68 CSRF_USE_SESSIONS = (
69     True  # Store the CSRF token in the users session instead of in a cookie
70 )
71 
72 CORS_ORIGIN_ALLOW_ALL = True
73 ROOT_URLCONF = "civiwiki.urls"
74 LOGIN_URL = "/login"
75 
76 # SSL Setup
77 if DJANGO_HOST != "LOCALHOST":
78     SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
79     SECURE_SSL_REDIRECT = True
80     SESSION_COOKIE_SECURE = True
81     CSRF_COOKIE_SECURE = True
82 
83 # Internationalization & Localization
84 LANGUAGE_CODE = "en-us"
85 TIME_ZONE = "UTC"
86 USE_I18N = True
87 USE_L10N = True
88 USE_TZ = True
89 
90 TEMPLATES = [
91     {
92         "BACKEND": "django.template.backends.django.DjangoTemplates",
93         "DIRS": [
94             os.path.join(BASE_DIR, "webapp/templates")
95         ],  # TODO: Add non-webapp template directory
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             ],
104         },
105     },
106 ]
107 
108 WSGI_APPLICATION = "civiwiki.wsgi.application"
109 
110 # Global user privilege settings
111 CLOSED_BETA = env("CLOSED_BETA", default=False)
112 
113 # Apex Contact for Production Errors
114 ADMINS = [("Development Team", "dev@civiwiki.org")]
115 
116 # API keys
117 SUNLIGHT_API_KEY = env("SUNLIGHT_API_KEY")
118 GOOGLE_API_KEY = env("GOOGLE_MAP_API_KEY")
119 
120 # Channels Setup
121 REDIS_URL = env("REDIS_URL", default="redis://localhost:6379")
122 CHANNEL_LAYERS = {
123     "default": {
124         "BACKEND": "asgi_redis.RedisChannelLayer",
125         "CONFIG": {
126             "hosts": [REDIS_URL],
127         },
128         "ROUTING": "civiwiki.routing.channel_routing",
129     },
130 }
131 
132 # Celery Task Runner Setup
133 CELERY_BROKER_URL = REDIS_URL + "/0"
134 CELERY_RESULT_BACKEND = CELERY_BROKER_URL
135 CELERY_ACCEPT_CONTENT = ["application/json"]
136 CELERY_TASK_SERIALIZER = "json"
137 CELERY_RESULT_SERIALIZER = "json"
138 CELERY_TIME_ZONE = TIME_ZONE
139 
140 # AWS S3 Setup
141 if "AWS_STORAGE_BUCKET_NAME" not in os.environ:
142     MEDIA_URL = "/media/"
143     MEDIA_ROOT = os.path.join(BASE_DIR, "media")
144 else:
145     AWS_STORAGE_BUCKET_NAME = env("AWS_STORAGE_BUCKET_NAME")
146     AWS_S3_ACCESS_KEY_ID = env("AWS_S3_ACCESS_KEY_ID")
147     AWS_S3_SECRET_ACCESS_KEY = env("AWS_S3_SECRET_ACCESS_KEY")
148     DEFAULT_FILE_STORAGE = "storages.backends.s3boto.S3BotoStorage"
149     AWS_S3_SECURE_URLS = False
150     AWS_QUERYSTRING_AUTH = False
151 
152 STATIC_URL = "/static/"
153 STATICFILES_DIRS = (os.path.join(BASE_DIR, "webapp/static"),)
154 STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
155 
156 # Database
157 if "CIVIWIKI_LOCAL_NAME" not in os.environ:
158     STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
159 
160     DATABASES = {"default": env.db()}
161 else:
162     DATABASES = {
163         "default": {
164             "HOST": env("CIVIWIKI_LOCAL_DB_HOST", "localhost"),
165             "PORT": "5432",
166             "NAME": env("CIVIWIKI_LOCAL_NAME"),
167             "ENGINE": "django.db.backends.postgresql_psycopg2",
168             "USER": env("CIVIWIKI_LOCAL_USERNAME"),
169             "PASSWORD": env("CIVIWIKI_LOCAL_PASSWORD"),
170         },
171     }
172 
173 # Email Backend Setup
174 if "EMAIL_HOST" not in os.environ:
175     EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
176     EMAIL_HOST_USER = "test@civiwiki.org"
177 else:
178     EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
179     EMAIL_HOST = env("EMAIL_HOST")
180     EMAIL_PORT = env("EMAIL_PORT")
181     EMAIL_HOST_USER = env("EMAIL_HOST_USER")
182     EMAIL_HOST_PASSWORD = env("EMAIL_HOST_PASSWORD")
183     EMAIL_USE_SSL = True
184     DEFAULT_FROM_EMAIL = EMAIL_HOST
185 
186 # Notification API Settings
187 NOTIFICATIONS_SOFT_DELETE = True
188 NOTIFICATIONS_USE_JSONFIELD = True
189 
190 # Django REST API Settings
191 DEFAULT_RENDERER_CLASSES = ("rest_framework.renderers.JSONRenderer",)
192 
193 DEFAULT_AUTHENTICATION_CLASSES = ("rest_framework.authentication.BasicAuthentication",)
194 
195 if DEBUG:
196     # Browsable HTML - Enabled only in Debug mode (dev)
197     DEFAULT_RENDERER_CLASSES = DEFAULT_RENDERER_CLASSES + (
198         "rest_framework.renderers.BrowsableAPIRenderer",
199     )
200 
201     DEFAULT_AUTHENTICATION_CLASSES = (
202         "api.authentication.CsrfExemptSessionAuthentication",
203     ) + DEFAULT_AUTHENTICATION_CLASSES
204 
205 REST_FRAMEWORK = {
206     "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",),
207     "DEFAULT_RENDERER_CLASSES": DEFAULT_RENDERER_CLASSES,
208     "DEFAULT_AUTHENTICATION_CLASSES": DEFAULT_AUTHENTICATION_CLASSES,
209 }
210 # CORS Settings
211 CORS_ORIGIN_ALLOW_ALL = True
212 PROPUBLICA_API_KEY = env("PROPUBLICA_API_KEY", default="TEST")
213
```
--- 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/project/civiwiki/settings.py b/project/civiwiki/settings.py
--- a/project/civiwiki/settings.py
+++ b/project/civiwiki/settings.py
@@ -5,13 +5,10 @@
 Production settings file to select proper environment variables.
 """
 import os
-import sentry_sdk
 import environ
 
 from django.core.exceptions import ImproperlyConfigured
 
-from sentry_sdk.integrations.django import DjangoIntegration
-
 env = environ.Env(
     # set casting, default value
     DEBUG=(bool, False)
@@ -22,11 +19,6 @@
 # False if not in os.environ
 DEBUG = env("DEBUG")
 
-if not DEBUG:
-    SENTRY_ADDRESS = env("SENTRY_ADDRESS")
-    if SENTRY_ADDRESS:
-        sentry_sdk.init(dsn=SENTRY_ADDRESS, integrations=[DjangoIntegration()])
-
 DJANGO_HOST = env("DJANGO_HOST", default="LOCALHOST")
 
 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

{"golden_diff": "diff --git a/project/civiwiki/settings.py b/project/civiwiki/settings.py\n--- a/project/civiwiki/settings.py\n+++ b/project/civiwiki/settings.py\n@@ -5,13 +5,10 @@\n Production settings file to select proper environment variables.\n \"\"\"\n import os\n-import sentry_sdk\n import environ\n \n from django.core.exceptions import ImproperlyConfigured\n \n-from sentry_sdk.integrations.django import DjangoIntegration\n-\n env = environ.Env(\n     # set casting, default value\n     DEBUG=(bool, False)\n@@ -22,11 +19,6 @@\n # False if not in os.environ\n DEBUG = env(\"DEBUG\")\n \n-if not DEBUG:\n-    SENTRY_ADDRESS = env(\"SENTRY_ADDRESS\")\n-    if SENTRY_ADDRESS:\n-        sentry_sdk.init(dsn=SENTRY_ADDRESS, integrations=[DjangoIntegration()])\n-\n DJANGO_HOST = env(\"DJANGO_HOST\", default=\"LOCALHOST\")\n \n BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\n", "issue": "Remove Sentry as a barrier to development\nOur project currently will not start without configuring a SENTRY_ADDRESS. In general, development should be as quick and painless as possible -- and not be inhibited by production concerns.\r\n\r\nFor the time being, since we are not in production, remove the dependency on Sentry.\n", "before_files": [{"content": "\"\"\"\nDjango settings for civiwiki project.\nDarius Calliet May 12, 2016\n\nProduction settings file to select proper environment variables.\n\"\"\"\nimport os\nimport sentry_sdk\nimport environ\n\nfrom django.core.exceptions import ImproperlyConfigured\n\nfrom sentry_sdk.integrations.django import DjangoIntegration\n\nenv = environ.Env(\n    # set casting, default value\n    DEBUG=(bool, False)\n)\n# reading .env file\nenviron.Env.read_env()\n\n# False if not in os.environ\nDEBUG = env(\"DEBUG\")\n\nif not DEBUG:\n    SENTRY_ADDRESS = env(\"SENTRY_ADDRESS\")\n    if SENTRY_ADDRESS:\n        sentry_sdk.init(dsn=SENTRY_ADDRESS, integrations=[DjangoIntegration()])\n\nDJANGO_HOST = env(\"DJANGO_HOST\", default=\"LOCALHOST\")\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nSECRET_KEY = env(\"DJANGO_SECRET_KEY\", default=\"TEST_KEY_FOR_DEVELOPMENT\")\nALLOWED_HOSTS = [\".herokuapp.com\", \".civiwiki.org\", \"127.0.0.1\", \"localhost\", \"0.0.0.0\"]\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_extensions\",\n    \"storages\",\n    \"channels\",\n    \"civiwiki\",\n    \"api\",\n    \"rest_framework\",\n    \"authentication\",\n    \"frontend_views\",\n    \"notifications\",\n    \"corsheaders\",\n)\n\nMIDDLEWARE = [\n    \"corsheaders.middleware.CorsMiddleware\",\n    \"django.middleware.security.SecurityMiddleware\",\n    \"whitenoise.middleware.WhiteNoiseMiddleware\",\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.auth.middleware.SessionAuthenticationMiddleware',\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n]\n\nCSRF_USE_SESSIONS = (\n    True  # Store the CSRF token in the users session instead of in a cookie\n)\n\nCORS_ORIGIN_ALLOW_ALL = True\nROOT_URLCONF = \"civiwiki.urls\"\nLOGIN_URL = \"/login\"\n\n# SSL Setup\nif DJANGO_HOST != \"LOCALHOST\":\n    SECURE_PROXY_SSL_HEADER = (\"HTTP_X_FORWARDED_PROTO\", \"https\")\n    SECURE_SSL_REDIRECT = True\n    SESSION_COOKIE_SECURE = True\n    CSRF_COOKIE_SECURE = True\n\n# Internationalization & Localization\nLANGUAGE_CODE = \"en-us\"\nTIME_ZONE = \"UTC\"\nUSE_I18N = True\nUSE_L10N = True\nUSE_TZ = True\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [\n            os.path.join(BASE_DIR, \"webapp/templates\")\n        ],  # TODO: Add non-webapp template directory\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            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = \"civiwiki.wsgi.application\"\n\n# Global user privilege settings\nCLOSED_BETA = env(\"CLOSED_BETA\", default=False)\n\n# Apex Contact for Production Errors\nADMINS = [(\"Development Team\", \"dev@civiwiki.org\")]\n\n# API keys\nSUNLIGHT_API_KEY = env(\"SUNLIGHT_API_KEY\")\nGOOGLE_API_KEY = env(\"GOOGLE_MAP_API_KEY\")\n\n# Channels Setup\nREDIS_URL = env(\"REDIS_URL\", default=\"redis://localhost:6379\")\nCHANNEL_LAYERS = {\n    \"default\": {\n        \"BACKEND\": \"asgi_redis.RedisChannelLayer\",\n        \"CONFIG\": {\n            \"hosts\": [REDIS_URL],\n        },\n        \"ROUTING\": \"civiwiki.routing.channel_routing\",\n    },\n}\n\n# Celery Task Runner Setup\nCELERY_BROKER_URL = REDIS_URL + \"/0\"\nCELERY_RESULT_BACKEND = CELERY_BROKER_URL\nCELERY_ACCEPT_CONTENT = [\"application/json\"]\nCELERY_TASK_SERIALIZER = \"json\"\nCELERY_RESULT_SERIALIZER = \"json\"\nCELERY_TIME_ZONE = TIME_ZONE\n\n# AWS S3 Setup\nif \"AWS_STORAGE_BUCKET_NAME\" not in os.environ:\n    MEDIA_URL = \"/media/\"\n    MEDIA_ROOT = os.path.join(BASE_DIR, \"media\")\nelse:\n    AWS_STORAGE_BUCKET_NAME = env(\"AWS_STORAGE_BUCKET_NAME\")\n    AWS_S3_ACCESS_KEY_ID = env(\"AWS_S3_ACCESS_KEY_ID\")\n    AWS_S3_SECRET_ACCESS_KEY = env(\"AWS_S3_SECRET_ACCESS_KEY\")\n    DEFAULT_FILE_STORAGE = \"storages.backends.s3boto.S3BotoStorage\"\n    AWS_S3_SECURE_URLS = False\n    AWS_QUERYSTRING_AUTH = False\n\nSTATIC_URL = \"/static/\"\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, \"webapp/static\"),)\nSTATIC_ROOT = os.path.join(BASE_DIR, \"staticfiles\")\n\n# Database\nif \"CIVIWIKI_LOCAL_NAME\" not in os.environ:\n    STATICFILES_STORAGE = \"whitenoise.storage.CompressedManifestStaticFilesStorage\"\n\n    DATABASES = {\"default\": env.db()}\nelse:\n    DATABASES = {\n        \"default\": {\n            \"HOST\": env(\"CIVIWIKI_LOCAL_DB_HOST\", \"localhost\"),\n            \"PORT\": \"5432\",\n            \"NAME\": env(\"CIVIWIKI_LOCAL_NAME\"),\n            \"ENGINE\": \"django.db.backends.postgresql_psycopg2\",\n            \"USER\": env(\"CIVIWIKI_LOCAL_USERNAME\"),\n            \"PASSWORD\": env(\"CIVIWIKI_LOCAL_PASSWORD\"),\n        },\n    }\n\n# Email Backend Setup\nif \"EMAIL_HOST\" not in os.environ:\n    EMAIL_BACKEND = \"django.core.mail.backends.console.EmailBackend\"\n    EMAIL_HOST_USER = \"test@civiwiki.org\"\nelse:\n    EMAIL_BACKEND = \"django.core.mail.backends.smtp.EmailBackend\"\n    EMAIL_HOST = env(\"EMAIL_HOST\")\n    EMAIL_PORT = env(\"EMAIL_PORT\")\n    EMAIL_HOST_USER = env(\"EMAIL_HOST_USER\")\n    EMAIL_HOST_PASSWORD = env(\"EMAIL_HOST_PASSWORD\")\n    EMAIL_USE_SSL = True\n    DEFAULT_FROM_EMAIL = EMAIL_HOST\n\n# Notification API Settings\nNOTIFICATIONS_SOFT_DELETE = True\nNOTIFICATIONS_USE_JSONFIELD = True\n\n# Django REST API Settings\nDEFAULT_RENDERER_CLASSES = (\"rest_framework.renderers.JSONRenderer\",)\n\nDEFAULT_AUTHENTICATION_CLASSES = (\"rest_framework.authentication.BasicAuthentication\",)\n\nif DEBUG:\n    # Browsable HTML - Enabled only in Debug mode (dev)\n    DEFAULT_RENDERER_CLASSES = DEFAULT_RENDERER_CLASSES + (\n        \"rest_framework.renderers.BrowsableAPIRenderer\",\n    )\n\n    DEFAULT_AUTHENTICATION_CLASSES = (\n        \"api.authentication.CsrfExemptSessionAuthentication\",\n    ) + DEFAULT_AUTHENTICATION_CLASSES\n\nREST_FRAMEWORK = {\n    \"DEFAULT_PERMISSION_CLASSES\": (\"rest_framework.permissions.IsAuthenticated\",),\n    \"DEFAULT_RENDERER_CLASSES\": DEFAULT_RENDERER_CLASSES,\n    \"DEFAULT_AUTHENTICATION_CLASSES\": DEFAULT_AUTHENTICATION_CLASSES,\n}\n# CORS Settings\nCORS_ORIGIN_ALLOW_ALL = True\nPROPUBLICA_API_KEY = env(\"PROPUBLICA_API_KEY\", default=\"TEST\")\n", "path": "project/civiwiki/settings.py"}], "after_files": [{"content": "\"\"\"\nDjango settings for civiwiki project.\nDarius Calliet May 12, 2016\n\nProduction settings file to select proper environment variables.\n\"\"\"\nimport os\nimport environ\n\nfrom django.core.exceptions import ImproperlyConfigured\n\nenv = environ.Env(\n    # set casting, default value\n    DEBUG=(bool, False)\n)\n# reading .env file\nenviron.Env.read_env()\n\n# False if not in os.environ\nDEBUG = env(\"DEBUG\")\n\nDJANGO_HOST = env(\"DJANGO_HOST\", default=\"LOCALHOST\")\n\nBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nSECRET_KEY = env(\"DJANGO_SECRET_KEY\", default=\"TEST_KEY_FOR_DEVELOPMENT\")\nALLOWED_HOSTS = [\".herokuapp.com\", \".civiwiki.org\", \"127.0.0.1\", \"localhost\", \"0.0.0.0\"]\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_extensions\",\n    \"storages\",\n    \"channels\",\n    \"civiwiki\",\n    \"api\",\n    \"rest_framework\",\n    \"authentication\",\n    \"frontend_views\",\n    \"notifications\",\n    \"corsheaders\",\n)\n\nMIDDLEWARE = [\n    \"corsheaders.middleware.CorsMiddleware\",\n    \"django.middleware.security.SecurityMiddleware\",\n    \"whitenoise.middleware.WhiteNoiseMiddleware\",\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.auth.middleware.SessionAuthenticationMiddleware',\n    \"django.contrib.messages.middleware.MessageMiddleware\",\n    \"django.middleware.clickjacking.XFrameOptionsMiddleware\",\n]\n\nCSRF_USE_SESSIONS = (\n    True  # Store the CSRF token in the users session instead of in a cookie\n)\n\nCORS_ORIGIN_ALLOW_ALL = True\nROOT_URLCONF = \"civiwiki.urls\"\nLOGIN_URL = \"/login\"\n\n# SSL Setup\nif DJANGO_HOST != \"LOCALHOST\":\n    SECURE_PROXY_SSL_HEADER = (\"HTTP_X_FORWARDED_PROTO\", \"https\")\n    SECURE_SSL_REDIRECT = True\n    SESSION_COOKIE_SECURE = True\n    CSRF_COOKIE_SECURE = True\n\n# Internationalization & Localization\nLANGUAGE_CODE = \"en-us\"\nTIME_ZONE = \"UTC\"\nUSE_I18N = True\nUSE_L10N = True\nUSE_TZ = True\n\nTEMPLATES = [\n    {\n        \"BACKEND\": \"django.template.backends.django.DjangoTemplates\",\n        \"DIRS\": [\n            os.path.join(BASE_DIR, \"webapp/templates\")\n        ],  # TODO: Add non-webapp template directory\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            ],\n        },\n    },\n]\n\nWSGI_APPLICATION = \"civiwiki.wsgi.application\"\n\n# Global user privilege settings\nCLOSED_BETA = env(\"CLOSED_BETA\", default=False)\n\n# Apex Contact for Production Errors\nADMINS = [(\"Development Team\", \"dev@civiwiki.org\")]\n\n# API keys\nSUNLIGHT_API_KEY = env(\"SUNLIGHT_API_KEY\")\nGOOGLE_API_KEY = env(\"GOOGLE_MAP_API_KEY\")\n\n# Channels Setup\nREDIS_URL = env(\"REDIS_URL\", default=\"redis://localhost:6379\")\nCHANNEL_LAYERS = {\n    \"default\": {\n        \"BACKEND\": \"asgi_redis.RedisChannelLayer\",\n        \"CONFIG\": {\n            \"hosts\": [REDIS_URL],\n        },\n        \"ROUTING\": \"civiwiki.routing.channel_routing\",\n    },\n}\n\n# Celery Task Runner Setup\nCELERY_BROKER_URL = REDIS_URL + \"/0\"\nCELERY_RESULT_BACKEND = CELERY_BROKER_URL\nCELERY_ACCEPT_CONTENT = [\"application/json\"]\nCELERY_TASK_SERIALIZER = \"json\"\nCELERY_RESULT_SERIALIZER = \"json\"\nCELERY_TIME_ZONE = TIME_ZONE\n\n# AWS S3 Setup\nif \"AWS_STORAGE_BUCKET_NAME\" not in os.environ:\n    MEDIA_URL = \"/media/\"\n    MEDIA_ROOT = os.path.join(BASE_DIR, \"media\")\nelse:\n    AWS_STORAGE_BUCKET_NAME = env(\"AWS_STORAGE_BUCKET_NAME\")\n    AWS_S3_ACCESS_KEY_ID = env(\"AWS_S3_ACCESS_KEY_ID\")\n    AWS_S3_SECRET_ACCESS_KEY = env(\"AWS_S3_SECRET_ACCESS_KEY\")\n    DEFAULT_FILE_STORAGE = \"storages.backends.s3boto.S3BotoStorage\"\n    AWS_S3_SECURE_URLS = False\n    AWS_QUERYSTRING_AUTH = False\n\nSTATIC_URL = \"/static/\"\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, \"webapp/static\"),)\nSTATIC_ROOT = os.path.join(BASE_DIR, \"staticfiles\")\n\n# Database\nif \"CIVIWIKI_LOCAL_NAME\" not in os.environ:\n    STATICFILES_STORAGE = \"whitenoise.storage.CompressedManifestStaticFilesStorage\"\n\n    DATABASES = {\"default\": env.db()}\nelse:\n    DATABASES = {\n        \"default\": {\n            \"HOST\": env(\"CIVIWIKI_LOCAL_DB_HOST\", \"localhost\"),\n            \"PORT\": \"5432\",\n            \"NAME\": env(\"CIVIWIKI_LOCAL_NAME\"),\n            \"ENGINE\": \"django.db.backends.postgresql_psycopg2\",\n            \"USER\": env(\"CIVIWIKI_LOCAL_USERNAME\"),\n            \"PASSWORD\": env(\"CIVIWIKI_LOCAL_PASSWORD\"),\n        },\n    }\n\n# Email Backend Setup\nif \"EMAIL_HOST\" not in os.environ:\n    EMAIL_BACKEND = \"django.core.mail.backends.console.EmailBackend\"\n    EMAIL_HOST_USER = \"test@civiwiki.org\"\nelse:\n    EMAIL_BACKEND = \"django.core.mail.backends.smtp.EmailBackend\"\n    EMAIL_HOST = env(\"EMAIL_HOST\")\n    EMAIL_PORT = env(\"EMAIL_PORT\")\n    EMAIL_HOST_USER = env(\"EMAIL_HOST_USER\")\n    EMAIL_HOST_PASSWORD = env(\"EMAIL_HOST_PASSWORD\")\n    EMAIL_USE_SSL = True\n    DEFAULT_FROM_EMAIL = EMAIL_HOST\n\n# Notification API Settings\nNOTIFICATIONS_SOFT_DELETE = True\nNOTIFICATIONS_USE_JSONFIELD = True\n\n# Django REST API Settings\nDEFAULT_RENDERER_CLASSES = (\"rest_framework.renderers.JSONRenderer\",)\n\nDEFAULT_AUTHENTICATION_CLASSES = (\"rest_framework.authentication.BasicAuthentication\",)\n\nif DEBUG:\n    # Browsable HTML - Enabled only in Debug mode (dev)\n    DEFAULT_RENDERER_CLASSES = DEFAULT_RENDERER_CLASSES + (\n        \"rest_framework.renderers.BrowsableAPIRenderer\",\n    )\n\n    DEFAULT_AUTHENTICATION_CLASSES = (\n        \"api.authentication.CsrfExemptSessionAuthentication\",\n    ) + DEFAULT_AUTHENTICATION_CLASSES\n\nREST_FRAMEWORK = {\n    \"DEFAULT_PERMISSION_CLASSES\": (\"rest_framework.permissions.IsAuthenticated\",),\n    \"DEFAULT_RENDERER_CLASSES\": DEFAULT_RENDERER_CLASSES,\n    \"DEFAULT_AUTHENTICATION_CLASSES\": DEFAULT_AUTHENTICATION_CLASSES,\n}\n# CORS Settings\nCORS_ORIGIN_ALLOW_ALL = True\nPROPUBLICA_API_KEY = env(\"PROPUBLICA_API_KEY\", default=\"TEST\")\n", "path": "project/civiwiki/settings.py"}]}