2017-04-10 23:18:00 +02:00
|
|
|
"""
|
|
|
|
Django development settings for the cof project.
|
|
|
|
The settings that are not listed here are imported from .common
|
|
|
|
"""
|
|
|
|
|
2017-08-09 21:48:20 +02:00
|
|
|
from .common import * # NOQA
|
2018-01-15 05:26:33 +01:00
|
|
|
from .common import INSTALLED_APPS, MIDDLEWARE, TESTING
|
2017-04-10 23:18:00 +02:00
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
2017-04-10 23:18:00 +02:00
|
|
|
|
|
|
|
DEBUG = True
|
|
|
|
|
2018-01-15 05:26:33 +01:00
|
|
|
if TESTING:
|
2018-10-06 12:35:49 +02:00
|
|
|
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
|
2018-01-15 05:26:33 +01:00
|
|
|
|
2017-04-10 23:18:00 +02:00
|
|
|
|
|
|
|
# ---
|
|
|
|
# Apache static/media config
|
|
|
|
# ---
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
STATIC_URL = "/static/"
|
|
|
|
STATIC_ROOT = "/srv/gestiocof/static/"
|
2017-04-10 23:18:00 +02:00
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
MEDIA_ROOT = "/srv/gestiocof/media/"
|
|
|
|
MEDIA_URL = "/media/"
|
2017-04-10 23:18:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
# Debug tool bar
|
|
|
|
# ---
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
|
2017-04-10 23:18:00 +02:00
|
|
|
def show_toolbar(request):
|
|
|
|
"""
|
|
|
|
On ne veut pas la vérification de INTERNAL_IPS faite par la debug-toolbar
|
|
|
|
car cela interfère avec l'utilisation de Vagrant. En effet, l'adresse de la
|
|
|
|
machine physique n'est pas forcément connue, et peut difficilement être
|
|
|
|
mise dans les INTERNAL_IPS.
|
|
|
|
"""
|
2019-01-07 22:34:28 +01:00
|
|
|
return DEBUG and not request.path.startswith("/admin/")
|
2017-04-10 23:18:00 +02:00
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
|
2018-01-15 05:26:33 +01:00
|
|
|
if not TESTING:
|
|
|
|
INSTALLED_APPS += ["debug_toolbar", "debug_panel"]
|
2017-11-19 18:41:39 +01:00
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
MIDDLEWARE = ["debug_panel.middleware.DebugPanelMiddleware"] + MIDDLEWARE
|
2017-11-19 18:41:39 +01:00
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
DEBUG_TOOLBAR_CONFIG = {"SHOW_TOOLBAR_CALLBACK": show_toolbar}
|