2017-06-23 21:00:42 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-06-09 13:36:16 +00:00
|
|
|
"""
|
2017-06-23 21:00:42 +00:00
|
|
|
Local settings
|
|
|
|
|
|
|
|
- Run in Debug mode
|
2021-06-17 15:55:12 +00:00
|
|
|
- Use console backend for e-mails
|
2017-06-23 21:00:42 +00:00
|
|
|
- Add Django Debug Toolbar
|
|
|
|
- Add django-extensions as app
|
2018-06-09 13:36:16 +00:00
|
|
|
"""
|
2017-06-23 21:00:42 +00:00
|
|
|
|
|
|
|
from .common import * # noqa
|
|
|
|
|
2018-06-10 10:06:46 +00:00
|
|
|
|
2017-06-23 21:00:42 +00:00
|
|
|
# DEBUG
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-06-09 13:36:16 +00:00
|
|
|
DEBUG = env.bool("DJANGO_DEBUG", default=True)
|
2019-01-10 10:55:48 +00:00
|
|
|
FORCE_HTTPS_URLS = env.bool("FORCE_HTTPS_URLS", default=False)
|
2018-06-09 13:36:16 +00:00
|
|
|
TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG
|
2017-06-23 21:00:42 +00:00
|
|
|
|
|
|
|
# SECRET CONFIGURATION
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
|
|
|
# Note: This key only used for development and testing.
|
2018-06-09 13:36:16 +00:00
|
|
|
SECRET_KEY = env(
|
|
|
|
"DJANGO_SECRET_KEY", default="mc$&b=5j#6^bv7tld1gyjp2&+^-qrdy=0sw@r5sua*1zp4fmxc"
|
|
|
|
)
|
2017-06-23 21:00:42 +00:00
|
|
|
|
|
|
|
# Mail settings
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-06-09 13:36:16 +00:00
|
|
|
EMAIL_HOST = "localhost"
|
2017-06-23 21:00:42 +00:00
|
|
|
EMAIL_PORT = 1025
|
|
|
|
|
|
|
|
# django-debug-toolbar
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# INTERNAL_IPS = ('127.0.0.1', '10.0.2.2',)
|
|
|
|
|
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
2018-06-09 13:36:16 +00:00
|
|
|
"DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
|
|
|
|
"SHOW_TEMPLATE_CONTEXT": True,
|
2019-10-22 08:58:37 +00:00
|
|
|
"SHOW_TOOLBAR_CALLBACK": lambda request: "debug" in request.GET,
|
2019-01-10 10:07:52 +00:00
|
|
|
"JQUERY_URL": "/staticfiles/admin/js/vendor/jquery/jquery.js",
|
2017-06-23 21:00:42 +00:00
|
|
|
}
|
2019-10-19 16:10:42 +00:00
|
|
|
# DEBUG_TOOLBAR_PANELS = [
|
|
|
|
# 'debug_toolbar.panels.versions.VersionsPanel',
|
|
|
|
# 'debug_toolbar.panels.timer.TimerPanel',
|
|
|
|
# 'debug_toolbar.panels.settings.SettingsPanel',
|
|
|
|
# 'debug_toolbar.panels.headers.HeadersPanel',
|
|
|
|
# 'debug_toolbar.panels.request.RequestPanel',
|
|
|
|
# 'debug_toolbar.panels.sql.SQLPanel',
|
|
|
|
# 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
|
|
|
|
# 'debug_toolbar.panels.templates.TemplatesPanel',
|
|
|
|
# 'debug_toolbar.panels.cache.CachePanel',
|
|
|
|
# 'debug_toolbar.panels.signals.SignalsPanel',
|
|
|
|
# 'debug_toolbar.panels.logging.LoggingPanel',
|
|
|
|
# 'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
|
|
# 'debug_toolbar.panels.profiling.ProfilingPanel',
|
|
|
|
# 'debug_toolbar_line_profiler.panel.ProfilingPanel'
|
|
|
|
# ]
|
2017-06-23 21:00:42 +00:00
|
|
|
|
2019-10-22 08:58:37 +00:00
|
|
|
DEBUG_TOOLBAR_PANELS = [
|
|
|
|
# 'debug_toolbar.panels.versions.VersionsPanel',
|
|
|
|
"debug_toolbar.panels.timer.TimerPanel",
|
|
|
|
"debug_toolbar.panels.settings.SettingsPanel",
|
|
|
|
"debug_toolbar.panels.headers.HeadersPanel",
|
|
|
|
# 'debug_toolbar.panels.request.RequestPanel',
|
|
|
|
"debug_toolbar.panels.sql.SQLPanel",
|
|
|
|
# 'debug_toolbar.panels.staticfiles.StaticFilesPanel',
|
|
|
|
# 'debug_toolbar.panels.templates.TemplatesPanel',
|
|
|
|
"debug_toolbar.panels.cache.CachePanel",
|
|
|
|
# 'debug_toolbar.panels.signals.SignalsPanel',
|
|
|
|
# 'debug_toolbar.panels.logging.LoggingPanel',
|
|
|
|
# 'debug_toolbar.panels.redirects.RedirectsPanel',
|
|
|
|
# 'debug_toolbar.panels.profiling.ProfilingPanel',
|
|
|
|
]
|
|
|
|
|
2017-06-23 21:00:42 +00:00
|
|
|
# django-extensions
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# INSTALLED_APPS += ('django_extensions', )
|
2019-01-04 10:47:23 +00:00
|
|
|
|
|
|
|
# Debug toolbar is slow, we disable it for tests
|
|
|
|
DEBUG_TOOLBAR_ENABLED = env.bool("DEBUG_TOOLBAR_ENABLED", default=DEBUG)
|
|
|
|
if DEBUG_TOOLBAR_ENABLED:
|
|
|
|
MIDDLEWARE += ("debug_toolbar.middleware.DebugToolbarMiddleware",)
|
|
|
|
INSTALLED_APPS += ("debug_toolbar",)
|
2017-06-23 21:00:42 +00:00
|
|
|
|
|
|
|
# TESTING
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-06-09 13:36:16 +00:00
|
|
|
TEST_RUNNER = "django.test.runner.DiscoverRunner"
|
2017-06-23 21:00:42 +00:00
|
|
|
|
2018-06-10 10:06:46 +00:00
|
|
|
# CELERY
|
2017-12-26 20:12:37 +00:00
|
|
|
CELERY_TASK_ALWAYS_EAGER = False
|
2018-06-10 10:06:46 +00:00
|
|
|
# END CELERY
|
2017-06-23 21:00:42 +00:00
|
|
|
|
|
|
|
# Your local stuff: Below this line define 3rd party library settings
|
|
|
|
|
2018-06-02 07:21:55 +00:00
|
|
|
CSRF_TRUSTED_ORIGINS = [o for o in ALLOWED_HOSTS]
|
2019-01-04 10:47:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
if env.bool("WEAK_PASSWORDS", default=False):
|
|
|
|
# Faster during tests
|
|
|
|
PASSWORD_HASHERS = ("django.contrib.auth.hashers.MD5PasswordHasher",)
|
2019-01-10 10:55:48 +00:00
|
|
|
|
2019-10-22 08:58:37 +00:00
|
|
|
MIDDLEWARE = (
|
|
|
|
"funkwhale_api.common.middleware.DevHttpsMiddleware",
|
|
|
|
"funkwhale_api.common.middleware.ProfilerMiddleware",
|
2021-04-08 13:03:42 +00:00
|
|
|
"funkwhale_api.common.middleware.PymallocMiddleware",
|
2019-10-22 08:58:37 +00:00
|
|
|
) + MIDDLEWARE
|