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
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
from .common import *
|
|
|
|
|
|
|
|
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|
|
|
|
|
|
|
DEBUG = True
|
|
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
# Apache static/media config
|
|
|
|
# ---
|
|
|
|
|
|
|
|
STATIC_URL = '/static/'
|
|
|
|
STATIC_ROOT = '/var/www/static/'
|
|
|
|
|
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
|
|
|
|
|
|
|
|
# ---
|
|
|
|
# Debug tool bar
|
|
|
|
# ---
|
|
|
|
|
2017-05-30 20:44:30 +02:00
|
|
|
# "Versions" panel of django-debug-toolbar <=1.8 is not compatible with
|
|
|
|
# wagtailmenus.
|
|
|
|
# See https://github.com/jazzband/django-debug-toolbar/issues/922
|
|
|
|
# TODO: Bug should be fixed in ddt 1.9 (not released yet). When fixed, this
|
|
|
|
# declaration may be removed.
|
|
|
|
DEBUG_TOOLBAR_PANELS = [
|
|
|
|
'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',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
"""
|
2017-04-17 20:45:01 +02:00
|
|
|
return DEBUG
|
2017-04-10 23:18:00 +02:00
|
|
|
|
2017-04-17 20:45:01 +02:00
|
|
|
INSTALLED_APPS += ["debug_toolbar", "debug_panel"]
|
2017-04-15 12:09:16 +02:00
|
|
|
MIDDLEWARE_CLASSES = (
|
2017-04-17 20:45:01 +02:00
|
|
|
["debug_panel.middleware.DebugPanelMiddleware"]
|
2017-04-15 12:09:16 +02:00
|
|
|
+ MIDDLEWARE_CLASSES
|
|
|
|
)
|
2017-04-10 23:18:00 +02:00
|
|
|
DEBUG_TOOLBAR_CONFIG = {
|
|
|
|
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
|
|
|
|
}
|