Split the settings in two files, secrets system

This commit is contained in:
Martin Pépin 2017-05-16 19:52:59 +01:00
parent e64c3d0b37
commit e28b73a2ec
6 changed files with 131 additions and 79 deletions

View file

@ -0,0 +1,44 @@
"""
Django development settings for GestionÉvénementiel
The settings that are not listed here are imported from .common
"""
from .common import * # NOQA
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DEBUG = True
# Add some debugging tools
INSTALLED_APPS += ["debug_toolbar", "debug_panel"] # NOQA
MIDDLEWARE_CLASSES = (
["debug_panel.middleware.DebugPanelMiddleware"]
+ MIDDLEWARE_CLASSES # NOQA
)
# ---
# Nginx static/media config
# ---
STATIC_ROOT = "/srv/GE/static/"
MEDIA_ROOT = "/srv/GE/media/"
# ---
# Debug tool bar
# ---
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.
"""
return DEBUG # True
DEBUG_TOOLBAR_CONFIG = {
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
}