Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions stade/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ def mutate_configuration(configuration: ComposedConfiguration) -> None:

configuration.AUTHENTICATION_BACKENDS.insert(0, 'rules.permissions.ObjectPermissionBackend')

# The leaderboard pages are large and highly repetitive, so compression shrinks them by
# an order of magnitude. Following cookiecutter-resonant, GZipMiddleware goes directly
# after WhiteNoiseMiddleware (WhiteNoise compresses static files itself), and the Debug
# Toolbar must come after any middleware that encodes the response's content.
gzip_middleware = 'django.middleware.gzip.GZipMiddleware'
configuration.MIDDLEWARE.insert(
configuration.MIDDLEWARE.index('whitenoise.middleware.WhiteNoiseMiddleware') + 1,
gzip_middleware,
)
debug_toolbar_middleware = 'debug_toolbar.middleware.DebugToolbarMiddleware'
if debug_toolbar_middleware in configuration.MIDDLEWARE:
configuration.MIDDLEWARE.remove(debug_toolbar_middleware)
configuration.MIDDLEWARE.insert(
configuration.MIDDLEWARE.index(gzip_middleware) + 1, debug_toolbar_middleware
)

JAZZMIN_SETTINGS = {'related_modal_active': True}
SHELL_PLUS_IMPORTS = ['from stade.core.tasks import *']

Expand Down
Loading