From 1bab75d13e7e7c389cd877c60a1487ccaae93e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Thu, 29 Sep 2016 00:51:36 +0200 Subject: [PATCH] Ajout des applis bootstrap et ddt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Installées comme requirements mais précédemment non incluses dans settings.INSTALLED_APPS --- evenementiel/settings_dev.py | 39 ++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/evenementiel/settings_dev.py b/evenementiel/settings_dev.py index a5851f6..09b66b1 100644 --- a/evenementiel/settings_dev.py +++ b/evenementiel/settings_dev.py @@ -37,6 +37,8 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'bootstrapform', + 'debug_toolbar', ] MIDDLEWARE_CLASSES = [ @@ -95,23 +97,17 @@ DATABASES = { } - # Password validation # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ - { - 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', - }, - { - 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', - }, + {'NAME': 'django.contrib.auth.password_validation' + '.UserAttributeSimilarityValidator'}, + {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'}, + {'NAME': 'django.contrib.auth.password_validation' + '.CommonPasswordValidator'}, + {'NAME': 'django.contrib.auth.password_validation' + '.NumericPasswordValidator'}, ] @@ -133,3 +129,20 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_URL = '/static/' + +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. + """ + if not DEBUG: + return False + if request.is_ajax(): + return False + return True + +DEBUG_TOOLBAR_CONFIG = { + 'SHOW_TOOLBAR_CALLBACK': show_toolbar, +}