We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Summernote boxes don't show
I've had this happen a few times today, not sure if reliably reproducible yet. Only affects develop branch. Master branch works fine. Probably a dependency issue. Making a note so we remember to do something about it before Nebelung.

![image](https://user-images.githubusercontent.com/1725499/85212714-5d9f7e80-b30a-11ea-8f0f-362b7f7b8706.png)

![image](https://user-images.githubusercontent.com/1725499/85212739-8b84c300-b30a-11ea-9fdd-bbcab720f3f4.png)

Browser shows error:

> Refused to display 'https://hidden-caverns-06472.herokuapp.com/summernote/editor/id_tournament_staff/' in a frame because it set 'X-Frame-Options' to 'deny'.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `tabbycat/settings/core.py`
Content:
```
1 import os
2 
3 from django.contrib.messages import constants as messages
4 from django.utils.translation import gettext_lazy as _
5 
6 
7 BASE_DIR = os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))
8 MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
9 
10 # ==============================================================================
11 # Overwritten in local.py or heroku.py
12 # ==============================================================================
13 
14 ADMINS = ('Philip and Chuan-Zheng', 'tabbycat@philipbelesky.com'),
15 MANAGERS = ADMINS
16 DEBUG = bool(int(os.environ['DEBUG'])) if 'DEBUG' in os.environ else False
17 ENABLE_DEBUG_TOOLBAR = False # Must default to false; overriden in Dev config
18 DISABLE_SENTRY = True # Overriden in Heroku config
19 SECRET_KEY = r'#2q43u&tp4((4&m3i8v%w-6z6pp7m(v0-6@w@i!j5n)n15epwc'
20 
21 # ==============================================================================
22 # Version
23 # ==============================================================================
24 
25 TABBYCAT_VERSION = '2.5.0-dev'
26 TABBYCAT_CODENAME = 'Nebelung'
27 READTHEDOCS_VERSION = 'v2.5.0-dev'
28 
29 # ==============================================================================
30 # Internationalization and Localization
31 # ==============================================================================
32 
33 USE_I18N = True
34 USE_TZ = True
35 USE_L10N = True
36 LANGUAGE_CODE = 'en'
37 TIME_ZONE = os.environ.get('TIME_ZONE', 'Australia/Melbourne')
38 
39 LOCALE_PATHS = [
40     os.path.join(BASE_DIR, 'locale'),
41 ]
42 
43 # Languages that should be available in the switcher
44 EXTRA_LANG_INFO = {
45     'ms': {
46         'bidi': False,
47         'code': 'ms',
48         'name': 'Malay',
49         'name_local': 'Bahasa Melayu', #unicode codepoints here
50     },
51 }
52 
53 # Add custom languages not provided by Django
54 import django.conf.locale
55 LANG_INFO = dict(django.conf.locale.LANG_INFO, **EXTRA_LANG_INFO)
56 django.conf.locale.LANG_INFO = LANG_INFO
57 
58 LANGUAGES = [
59     ('ar', _('Arabic')),
60     ('bn', _('Bengali')),
61     ('en', _('English')),
62     ('es', _('Spanish')),
63     ('fr', _('French')),
64     ('ja', _('Japanese')),
65     ('ms', _('Malay')),
66     ('pt', _('Portuguese')),
67     ('ru', _('Russian')),
68     ('zh-hans', _('Simplified Chinese')),
69 ]
70 
71 STATICI18N_ROOT = os.path.join(BASE_DIR, "locale")
72 
73 FORMAT_MODULE_PATH = [
74     'utils.formats',
75 ]
76 
77 # ==============================================================================
78 # Django-specific Modules
79 # ==============================================================================
80 
81 MIDDLEWARE = [
82     'django.middleware.gzip.GZipMiddleware',
83     'django.middleware.security.SecurityMiddleware',
84     'django.contrib.sessions.middleware.SessionMiddleware',
85     # User language preferences; must be after Session
86     'django.middleware.locale.LocaleMiddleware',
87     # Set Etags; i.e. cached requests not on network; must precede Common
88     'django.middleware.http.ConditionalGetMiddleware',
89     'django.middleware.common.CommonMiddleware',
90     # Must be after SessionMiddleware
91     'django.contrib.auth.middleware.AuthenticationMiddleware',
92     'django.middleware.common.CommonMiddleware',
93     # Must be after SessionMiddleware
94     'django.contrib.messages.middleware.MessageMiddleware',
95     'django.middleware.clickjacking.XFrameOptionsMiddleware',
96     'utils.middleware.DebateMiddleware',
97 ]
98 
99 TABBYCAT_APPS = (
100     'actionlog',
101     'adjallocation',
102     'adjfeedback',
103     'api',
104     'availability',
105     'breakqual',
106     'checkins',
107     'divisions', # obsolete
108     'draw',
109     'motions',
110     'options',
111     'participants',
112     'printing',
113     'privateurls',
114     'results',
115     'tournaments',
116     'venues',
117     'utils',
118     'users',
119     'standings',
120     'notifications',
121     'importer',
122 )
123 
124 INSTALLED_APPS = (
125     'jet',
126     'django.contrib.admin',
127     'django.contrib.auth',
128     'django.contrib.contenttypes',
129     'django.contrib.sessions',
130     'channels', # For Websockets / real-time connections (above whitenoise)
131     'django.contrib.staticfiles',
132     'django.contrib.humanize',
133     'django_summernote',  # Keep above our apps; as we unregister an admin model
134     'django.contrib.messages') \
135     + TABBYCAT_APPS + (
136     'dynamic_preferences',
137     'django_extensions',  # For Secret Generation Command
138     'gfklookupwidget',
139     'formtools',
140     'statici18n', # Compile js translations as static file; saving requests
141     'polymorphic',
142     'rest_framework',
143     'rest_framework.authtoken',
144 )
145 
146 ROOT_URLCONF = 'urls'
147 LOGIN_REDIRECT_URL = '/'
148 FIXTURE_DIRS = (os.path.join(os.path.dirname(BASE_DIR), 'data', 'fixtures'), )
149 SILENCED_SYSTEM_CHECKS = ('urls.W002',)
150 
151 # ==============================================================================
152 # Templates
153 # ==============================================================================
154 
155 TEMPLATES = [
156     {
157         'BACKEND': 'django.template.backends.django.DjangoTemplates',
158         'DIRS': [os.path.join(BASE_DIR, 'templates')],
159         'OPTIONS': {
160             'context_processors': [
161                 'django.contrib.auth.context_processors.auth',
162                 'django.contrib.messages.context_processors.messages',
163                 'django.template.context_processors.debug',
164                 'django.template.context_processors.i18n',
165                 'django.template.context_processors.media',
166                 'django.template.context_processors.static',
167                 'django.template.context_processors.tz',
168                 'django.template.context_processors.request',  # for Jet
169                 'utils.context_processors.debate_context',  # for tournament config vars
170                 'django.template.context_processors.i18n'  # for serving static language translations,
171             ],
172             'loaders': [
173                 ('django.template.loaders.cached.Loader', [
174                     'django.template.loaders.filesystem.Loader',
175                     'django.template.loaders.app_directories.Loader',
176                 ]),
177             ],
178         }
179     },
180 ]
181 
182 # ==============================================================================
183 # Caching
184 # ==============================================================================
185 
186 PUBLIC_FAST_CACHE_TIMEOUT = int(os.environ.get('PUBLIC_FAST_CACHE_TIMEOUT', 60 * 1))
187 PUBLIC_SLOW_CACHE_TIMEOUT = int(os.environ.get('PUBLIC_SLOW_CACHE_TIMEOUT', 60 * 3.5))
188 TAB_PAGES_CACHE_TIMEOUT = int(os.environ.get('TAB_PAGES_CACHE_TIMEOUT', 60 * 120))
189 
190 # Default non-heroku cache is to use local memory
191 CACHES = {
192     'default': {
193         'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
194     },
195 }
196 
197 SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
198 
199 # ==============================================================================
200 # Static Files and Compilation
201 # ==============================================================================
202 
203 STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
204 STATIC_URL = '/static/'
205 
206 STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'), )
207 
208 STATICFILES_FINDERS = (
209     'django.contrib.staticfiles.finders.FileSystemFinder',
210     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
211 )
212 
213 STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
214 
215 # ==============================================================================
216 # Logging
217 # ==============================================================================
218 
219 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
220 
221 LOGGING = {
222     'version': 1,
223     'disable_existing_loggers': False,
224     'handlers': {
225         'console': {
226             'class': 'logging.StreamHandler',
227             'formatter': 'standard',
228         },
229     },
230     'loggers': {
231         'django': {
232             'handlers': ['console'],
233             'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
234         },
235         'sentry.errors': {
236             'level': 'INFO',
237             'handlers': ['console'],
238             'propagate': False,
239         },
240     },
241     'formatters': {
242         'standard': {
243             'format': '[%(asctime)s] %(levelname)s %(name)s: %(message)s',
244         },
245     },
246 }
247 
248 for app in TABBYCAT_APPS:
249     LOGGING['loggers'][app] = {
250         'handlers': ['console'],
251         'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),
252     }
253 
254 # ==============================================================================
255 # Messages
256 # ==============================================================================
257 
258 MESSAGE_TAGS = {messages.ERROR: 'danger', }
259 
260 # ==============================================================================
261 # Summernote (WYSWIG)
262 # ==============================================================================
263 
264 SUMMERNOTE_THEME = 'bs4' # Bootstrap 4
265 
266 SUMMERNOTE_CONFIG = {
267     'width': '100%',
268     'height': '480',
269     'toolbar': [
270         ['style', ['bold', 'italic', 'underline', 'fontsize', 'color', 'clear']],
271         ['para', ['ul', 'ol']],
272         ['insert', ['link', 'picture']],
273         ['misc', ['undo', 'redo', 'codeview']],
274     ],
275     'disable_upload': True,
276     'iframe': True, # Necessary; if just to compartmentalise jQuery dependency,
277 }
278 
279 # ==============================================================================
280 # Database
281 # ==============================================================================
282 
283 DATABASES = {
284     'default': {
285         'ENGINE': 'django.db.backends.postgresql',
286     },
287 }
288 
289 # ==============================================================================
290 # Channels
291 # ==============================================================================
292 
293 ASGI_APPLICATION = "routing.application"
294 
295 CHANNEL_LAYERS = {
296     "default": {
297         "BACKEND": "channels.layers.InMemoryChannelLayer",
298     },
299 }
300 
301 # ==============================================================================
302 # Dynamic preferences
303 # ==============================================================================
304 
305 DYNAMIC_PREFERENCES = {
306     'REGISTRY_MODULE': 'preferences',
307 }
308 
309 # ==============================================================================
310 # REST Framework
311 # ==============================================================================
312 
313 REST_FRAMEWORK = {
314     'DEFAULT_RENDERER_CLASSES': [
315         'rest_framework.renderers.JSONRenderer',
316     ],
317     'DEFAULT_PARSER_CLASSES': [
318         'rest_framework.parsers.JSONParser',
319     ],
320     'DEFAULT_AUTHENTICATION_CLASSES': [
321         'rest_framework.authentication.TokenAuthentication',
322     ],
323     'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
324 }
325
```
--- 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/tabbycat/settings/core.py b/tabbycat/settings/core.py
--- a/tabbycat/settings/core.py
+++ b/tabbycat/settings/core.py
@@ -276,6 +276,8 @@
     'iframe': True, # Necessary; if just to compartmentalise jQuery dependency,
 }
 
+X_FRAME_OPTIONS = 'SAMEORIGIN' # Necessary to get Django-Summernote working because of Django 3 changes
+
 # ==============================================================================
 # Database
 # ==============================================================================

{"golden_diff": "diff --git a/tabbycat/settings/core.py b/tabbycat/settings/core.py\n--- a/tabbycat/settings/core.py\n+++ b/tabbycat/settings/core.py\n@@ -276,6 +276,8 @@\n     'iframe': True, # Necessary; if just to compartmentalise jQuery dependency,\n }\n \n+X_FRAME_OPTIONS = 'SAMEORIGIN' # Necessary to get Django-Summernote working because of Django 3 changes\n+\n # ==============================================================================\n # Database\n # ==============================================================================\n", "issue": "Summernote boxes don't show\nI've had this happen a few times today, not sure if reliably reproducible yet. Only affects develop branch. Master branch works fine. Probably a dependency issue. Making a note so we remember to do something about it before Nebelung.\r\n\r\n![image](https://user-images.githubusercontent.com/1725499/85212714-5d9f7e80-b30a-11ea-8f0f-362b7f7b8706.png)\r\n\r\n![image](https://user-images.githubusercontent.com/1725499/85212739-8b84c300-b30a-11ea-9fdd-bbcab720f3f4.png)\r\n\r\nBrowser shows error:\r\n\r\n> Refused to display 'https://hidden-caverns-06472.herokuapp.com/summernote/editor/id_tournament_staff/' in a frame because it set 'X-Frame-Options' to 'deny'.\r\n\n", "before_files": [{"content": "import os\n\nfrom django.contrib.messages import constants as messages\nfrom django.utils.translation import gettext_lazy as _\n\n\nBASE_DIR = os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))\nMEDIA_ROOT = os.path.join(BASE_DIR, 'media')\n\n# ==============================================================================\n# Overwritten in local.py or heroku.py\n# ==============================================================================\n\nADMINS = ('Philip and Chuan-Zheng', 'tabbycat@philipbelesky.com'),\nMANAGERS = ADMINS\nDEBUG = bool(int(os.environ['DEBUG'])) if 'DEBUG' in os.environ else False\nENABLE_DEBUG_TOOLBAR = False # Must default to false; overriden in Dev config\nDISABLE_SENTRY = True # Overriden in Heroku config\nSECRET_KEY = r'#2q43u&tp4((4&m3i8v%w-6z6pp7m(v0-6@w@i!j5n)n15epwc'\n\n# ==============================================================================\n# Version\n# ==============================================================================\n\nTABBYCAT_VERSION = '2.5.0-dev'\nTABBYCAT_CODENAME = 'Nebelung'\nREADTHEDOCS_VERSION = 'v2.5.0-dev'\n\n# ==============================================================================\n# Internationalization and Localization\n# ==============================================================================\n\nUSE_I18N = True\nUSE_TZ = True\nUSE_L10N = True\nLANGUAGE_CODE = 'en'\nTIME_ZONE = os.environ.get('TIME_ZONE', 'Australia/Melbourne')\n\nLOCALE_PATHS = [\n    os.path.join(BASE_DIR, 'locale'),\n]\n\n# Languages that should be available in the switcher\nEXTRA_LANG_INFO = {\n    'ms': {\n        'bidi': False,\n        'code': 'ms',\n        'name': 'Malay',\n        'name_local': 'Bahasa Melayu', #unicode codepoints here\n    },\n}\n\n# Add custom languages not provided by Django\nimport django.conf.locale\nLANG_INFO = dict(django.conf.locale.LANG_INFO, **EXTRA_LANG_INFO)\ndjango.conf.locale.LANG_INFO = LANG_INFO\n\nLANGUAGES = [\n    ('ar', _('Arabic')),\n    ('bn', _('Bengali')),\n    ('en', _('English')),\n    ('es', _('Spanish')),\n    ('fr', _('French')),\n    ('ja', _('Japanese')),\n    ('ms', _('Malay')),\n    ('pt', _('Portuguese')),\n    ('ru', _('Russian')),\n    ('zh-hans', _('Simplified Chinese')),\n]\n\nSTATICI18N_ROOT = os.path.join(BASE_DIR, \"locale\")\n\nFORMAT_MODULE_PATH = [\n    'utils.formats',\n]\n\n# ==============================================================================\n# Django-specific Modules\n# ==============================================================================\n\nMIDDLEWARE = [\n    'django.middleware.gzip.GZipMiddleware',\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    # User language preferences; must be after Session\n    'django.middleware.locale.LocaleMiddleware',\n    # Set Etags; i.e. cached requests not on network; must precede Common\n    'django.middleware.http.ConditionalGetMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    # Must be after SessionMiddleware\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    # Must be after SessionMiddleware\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    'utils.middleware.DebateMiddleware',\n]\n\nTABBYCAT_APPS = (\n    'actionlog',\n    'adjallocation',\n    'adjfeedback',\n    'api',\n    'availability',\n    'breakqual',\n    'checkins',\n    'divisions', # obsolete\n    'draw',\n    'motions',\n    'options',\n    'participants',\n    'printing',\n    'privateurls',\n    'results',\n    'tournaments',\n    'venues',\n    'utils',\n    'users',\n    'standings',\n    'notifications',\n    'importer',\n)\n\nINSTALLED_APPS = (\n    'jet',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'channels', # For Websockets / real-time connections (above whitenoise)\n    'django.contrib.staticfiles',\n    'django.contrib.humanize',\n    'django_summernote',  # Keep above our apps; as we unregister an admin model\n    'django.contrib.messages') \\\n    + TABBYCAT_APPS + (\n    'dynamic_preferences',\n    'django_extensions',  # For Secret Generation Command\n    'gfklookupwidget',\n    'formtools',\n    'statici18n', # Compile js translations as static file; saving requests\n    'polymorphic',\n    'rest_framework',\n    'rest_framework.authtoken',\n)\n\nROOT_URLCONF = 'urls'\nLOGIN_REDIRECT_URL = '/'\nFIXTURE_DIRS = (os.path.join(os.path.dirname(BASE_DIR), 'data', 'fixtures'), )\nSILENCED_SYSTEM_CHECKS = ('urls.W002',)\n\n# ==============================================================================\n# Templates\n# ==============================================================================\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [os.path.join(BASE_DIR, 'templates')],\n        'OPTIONS': {\n            'context_processors': [\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n                'django.template.context_processors.debug',\n                'django.template.context_processors.i18n',\n                'django.template.context_processors.media',\n                'django.template.context_processors.static',\n                'django.template.context_processors.tz',\n                'django.template.context_processors.request',  # for Jet\n                'utils.context_processors.debate_context',  # for tournament config vars\n                'django.template.context_processors.i18n'  # for serving static language translations,\n            ],\n            'loaders': [\n                ('django.template.loaders.cached.Loader', [\n                    'django.template.loaders.filesystem.Loader',\n                    'django.template.loaders.app_directories.Loader',\n                ]),\n            ],\n        }\n    },\n]\n\n# ==============================================================================\n# Caching\n# ==============================================================================\n\nPUBLIC_FAST_CACHE_TIMEOUT = int(os.environ.get('PUBLIC_FAST_CACHE_TIMEOUT', 60 * 1))\nPUBLIC_SLOW_CACHE_TIMEOUT = int(os.environ.get('PUBLIC_SLOW_CACHE_TIMEOUT', 60 * 3.5))\nTAB_PAGES_CACHE_TIMEOUT = int(os.environ.get('TAB_PAGES_CACHE_TIMEOUT', 60 * 120))\n\n# Default non-heroku cache is to use local memory\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',\n    },\n}\n\nSESSION_ENGINE = 'django.contrib.sessions.backends.cache'\n\n# ==============================================================================\n# Static Files and Compilation\n# ==============================================================================\n\nSTATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')\nSTATIC_URL = '/static/'\n\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'), )\n\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n)\n\nSTATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'\n\n# ==============================================================================\n# Logging\n# ==============================================================================\n\nMESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'handlers': {\n        'console': {\n            'class': 'logging.StreamHandler',\n            'formatter': 'standard',\n        },\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['console'],\n            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),\n        },\n        'sentry.errors': {\n            'level': 'INFO',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n    },\n    'formatters': {\n        'standard': {\n            'format': '[%(asctime)s] %(levelname)s %(name)s: %(message)s',\n        },\n    },\n}\n\nfor app in TABBYCAT_APPS:\n    LOGGING['loggers'][app] = {\n        'handlers': ['console'],\n        'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),\n    }\n\n# ==============================================================================\n# Messages\n# ==============================================================================\n\nMESSAGE_TAGS = {messages.ERROR: 'danger', }\n\n# ==============================================================================\n# Summernote (WYSWIG)\n# ==============================================================================\n\nSUMMERNOTE_THEME = 'bs4' # Bootstrap 4\n\nSUMMERNOTE_CONFIG = {\n    'width': '100%',\n    'height': '480',\n    'toolbar': [\n        ['style', ['bold', 'italic', 'underline', 'fontsize', 'color', 'clear']],\n        ['para', ['ul', 'ol']],\n        ['insert', ['link', 'picture']],\n        ['misc', ['undo', 'redo', 'codeview']],\n    ],\n    'disable_upload': True,\n    'iframe': True, # Necessary; if just to compartmentalise jQuery dependency,\n}\n\n# ==============================================================================\n# Database\n# ==============================================================================\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n    },\n}\n\n# ==============================================================================\n# Channels\n# ==============================================================================\n\nASGI_APPLICATION = \"routing.application\"\n\nCHANNEL_LAYERS = {\n    \"default\": {\n        \"BACKEND\": \"channels.layers.InMemoryChannelLayer\",\n    },\n}\n\n# ==============================================================================\n# Dynamic preferences\n# ==============================================================================\n\nDYNAMIC_PREFERENCES = {\n    'REGISTRY_MODULE': 'preferences',\n}\n\n# ==============================================================================\n# REST Framework\n# ==============================================================================\n\nREST_FRAMEWORK = {\n    'DEFAULT_RENDERER_CLASSES': [\n        'rest_framework.renderers.JSONRenderer',\n    ],\n    'DEFAULT_PARSER_CLASSES': [\n        'rest_framework.parsers.JSONParser',\n    ],\n    'DEFAULT_AUTHENTICATION_CLASSES': [\n        'rest_framework.authentication.TokenAuthentication',\n    ],\n    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',\n}\n", "path": "tabbycat/settings/core.py"}], "after_files": [{"content": "import os\n\nfrom django.contrib.messages import constants as messages\nfrom django.utils.translation import gettext_lazy as _\n\n\nBASE_DIR = os.path.dirname(os.path.abspath(os.path.join(__file__, os.pardir)))\nMEDIA_ROOT = os.path.join(BASE_DIR, 'media')\n\n# ==============================================================================\n# Overwritten in local.py or heroku.py\n# ==============================================================================\n\nADMINS = ('Philip and Chuan-Zheng', 'tabbycat@philipbelesky.com'),\nMANAGERS = ADMINS\nDEBUG = bool(int(os.environ['DEBUG'])) if 'DEBUG' in os.environ else False\nENABLE_DEBUG_TOOLBAR = False # Must default to false; overriden in Dev config\nDISABLE_SENTRY = True # Overriden in Heroku config\nSECRET_KEY = r'#2q43u&tp4((4&m3i8v%w-6z6pp7m(v0-6@w@i!j5n)n15epwc'\n\n# ==============================================================================\n# Version\n# ==============================================================================\n\nTABBYCAT_VERSION = '2.5.0-dev'\nTABBYCAT_CODENAME = 'Nebelung'\nREADTHEDOCS_VERSION = 'v2.5.0-dev'\n\n# ==============================================================================\n# Internationalization and Localization\n# ==============================================================================\n\nUSE_I18N = True\nUSE_TZ = True\nUSE_L10N = True\nLANGUAGE_CODE = 'en'\nTIME_ZONE = os.environ.get('TIME_ZONE', 'Australia/Melbourne')\n\nLOCALE_PATHS = [\n    os.path.join(BASE_DIR, 'locale'),\n]\n\n# Languages that should be available in the switcher\nEXTRA_LANG_INFO = {\n    'ms': {\n        'bidi': False,\n        'code': 'ms',\n        'name': 'Malay',\n        'name_local': 'Bahasa Melayu', #unicode codepoints here\n    },\n}\n\n# Add custom languages not provided by Django\nimport django.conf.locale\nLANG_INFO = dict(django.conf.locale.LANG_INFO, **EXTRA_LANG_INFO)\ndjango.conf.locale.LANG_INFO = LANG_INFO\n\nLANGUAGES = [\n    ('ar', _('Arabic')),\n    ('bn', _('Bengali')),\n    ('en', _('English')),\n    ('es', _('Spanish')),\n    ('fr', _('French')),\n    ('ja', _('Japanese')),\n    ('ms', _('Malay')),\n    ('pt', _('Portuguese')),\n    ('ru', _('Russian')),\n    ('zh-hans', _('Simplified Chinese')),\n]\n\nSTATICI18N_ROOT = os.path.join(BASE_DIR, \"locale\")\n\nFORMAT_MODULE_PATH = [\n    'utils.formats',\n]\n\n# ==============================================================================\n# Django-specific Modules\n# ==============================================================================\n\nMIDDLEWARE = [\n    'django.middleware.gzip.GZipMiddleware',\n    'django.middleware.security.SecurityMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    # User language preferences; must be after Session\n    'django.middleware.locale.LocaleMiddleware',\n    # Set Etags; i.e. cached requests not on network; must precede Common\n    'django.middleware.http.ConditionalGetMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    # Must be after SessionMiddleware\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.middleware.common.CommonMiddleware',\n    # Must be after SessionMiddleware\n    'django.contrib.messages.middleware.MessageMiddleware',\n    'django.middleware.clickjacking.XFrameOptionsMiddleware',\n    'utils.middleware.DebateMiddleware',\n]\n\nTABBYCAT_APPS = (\n    'actionlog',\n    'adjallocation',\n    'adjfeedback',\n    'api',\n    'availability',\n    'breakqual',\n    'checkins',\n    'divisions', # obsolete\n    'draw',\n    'motions',\n    'options',\n    'participants',\n    'printing',\n    'privateurls',\n    'results',\n    'tournaments',\n    'venues',\n    'utils',\n    'users',\n    'standings',\n    'notifications',\n    'importer',\n)\n\nINSTALLED_APPS = (\n    'jet',\n    'django.contrib.admin',\n    'django.contrib.auth',\n    'django.contrib.contenttypes',\n    'django.contrib.sessions',\n    'channels', # For Websockets / real-time connections (above whitenoise)\n    'django.contrib.staticfiles',\n    'django.contrib.humanize',\n    'django_summernote',  # Keep above our apps; as we unregister an admin model\n    'django.contrib.messages') \\\n    + TABBYCAT_APPS + (\n    'dynamic_preferences',\n    'django_extensions',  # For Secret Generation Command\n    'gfklookupwidget',\n    'formtools',\n    'statici18n', # Compile js translations as static file; saving requests\n    'polymorphic',\n    'rest_framework',\n    'rest_framework.authtoken',\n)\n\nROOT_URLCONF = 'urls'\nLOGIN_REDIRECT_URL = '/'\nFIXTURE_DIRS = (os.path.join(os.path.dirname(BASE_DIR), 'data', 'fixtures'), )\nSILENCED_SYSTEM_CHECKS = ('urls.W002',)\n\n# ==============================================================================\n# Templates\n# ==============================================================================\n\nTEMPLATES = [\n    {\n        'BACKEND': 'django.template.backends.django.DjangoTemplates',\n        'DIRS': [os.path.join(BASE_DIR, 'templates')],\n        'OPTIONS': {\n            'context_processors': [\n                'django.contrib.auth.context_processors.auth',\n                'django.contrib.messages.context_processors.messages',\n                'django.template.context_processors.debug',\n                'django.template.context_processors.i18n',\n                'django.template.context_processors.media',\n                'django.template.context_processors.static',\n                'django.template.context_processors.tz',\n                'django.template.context_processors.request',  # for Jet\n                'utils.context_processors.debate_context',  # for tournament config vars\n                'django.template.context_processors.i18n'  # for serving static language translations,\n            ],\n            'loaders': [\n                ('django.template.loaders.cached.Loader', [\n                    'django.template.loaders.filesystem.Loader',\n                    'django.template.loaders.app_directories.Loader',\n                ]),\n            ],\n        }\n    },\n]\n\n# ==============================================================================\n# Caching\n# ==============================================================================\n\nPUBLIC_FAST_CACHE_TIMEOUT = int(os.environ.get('PUBLIC_FAST_CACHE_TIMEOUT', 60 * 1))\nPUBLIC_SLOW_CACHE_TIMEOUT = int(os.environ.get('PUBLIC_SLOW_CACHE_TIMEOUT', 60 * 3.5))\nTAB_PAGES_CACHE_TIMEOUT = int(os.environ.get('TAB_PAGES_CACHE_TIMEOUT', 60 * 120))\n\n# Default non-heroku cache is to use local memory\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',\n    },\n}\n\nSESSION_ENGINE = 'django.contrib.sessions.backends.cache'\n\n# ==============================================================================\n# Static Files and Compilation\n# ==============================================================================\n\nSTATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')\nSTATIC_URL = '/static/'\n\nSTATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'), )\n\nSTATICFILES_FINDERS = (\n    'django.contrib.staticfiles.finders.FileSystemFinder',\n    'django.contrib.staticfiles.finders.AppDirectoriesFinder',\n)\n\nSTATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'\n\n# ==============================================================================\n# Logging\n# ==============================================================================\n\nMESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'\n\nLOGGING = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'handlers': {\n        'console': {\n            'class': 'logging.StreamHandler',\n            'formatter': 'standard',\n        },\n    },\n    'loggers': {\n        'django': {\n            'handlers': ['console'],\n            'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),\n        },\n        'sentry.errors': {\n            'level': 'INFO',\n            'handlers': ['console'],\n            'propagate': False,\n        },\n    },\n    'formatters': {\n        'standard': {\n            'format': '[%(asctime)s] %(levelname)s %(name)s: %(message)s',\n        },\n    },\n}\n\nfor app in TABBYCAT_APPS:\n    LOGGING['loggers'][app] = {\n        'handlers': ['console'],\n        'level': os.getenv('DJANGO_LOG_LEVEL', 'INFO'),\n    }\n\n# ==============================================================================\n# Messages\n# ==============================================================================\n\nMESSAGE_TAGS = {messages.ERROR: 'danger', }\n\n# ==============================================================================\n# Summernote (WYSWIG)\n# ==============================================================================\n\nSUMMERNOTE_THEME = 'bs4' # Bootstrap 4\n\nSUMMERNOTE_CONFIG = {\n    'width': '100%',\n    'height': '480',\n    'toolbar': [\n        ['style', ['bold', 'italic', 'underline', 'fontsize', 'color', 'clear']],\n        ['para', ['ul', 'ol']],\n        ['insert', ['link', 'picture']],\n        ['misc', ['undo', 'redo', 'codeview']],\n    ],\n    'disable_upload': True,\n    'iframe': True, # Necessary; if just to compartmentalise jQuery dependency,\n}\n\nX_FRAME_OPTIONS = 'SAMEORIGIN' # Necessary to get Django-Summernote working because of Django 3 changes\n\n# ==============================================================================\n# Database\n# ==============================================================================\n\nDATABASES = {\n    'default': {\n        'ENGINE': 'django.db.backends.postgresql',\n    },\n}\n\n# ==============================================================================\n# Channels\n# ==============================================================================\n\nASGI_APPLICATION = \"routing.application\"\n\nCHANNEL_LAYERS = {\n    \"default\": {\n        \"BACKEND\": \"channels.layers.InMemoryChannelLayer\",\n    },\n}\n\n# ==============================================================================\n# Dynamic preferences\n# ==============================================================================\n\nDYNAMIC_PREFERENCES = {\n    'REGISTRY_MODULE': 'preferences',\n}\n\n# ==============================================================================\n# REST Framework\n# ==============================================================================\n\nREST_FRAMEWORK = {\n    'DEFAULT_RENDERER_CLASSES': [\n        'rest_framework.renderers.JSONRenderer',\n    ],\n    'DEFAULT_PARSER_CLASSES': [\n        'rest_framework.parsers.JSONParser',\n    ],\n    'DEFAULT_AUTHENTICATION_CLASSES': [\n        'rest_framework.authentication.TokenAuthentication',\n    ],\n    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',\n}\n", "path": "tabbycat/settings/core.py"}]}