forked from DGNum/gestioCOF
53 lines
1.1 KiB
Python
53 lines
1.1 KiB
Python
|
"""
|
||
|
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
|
||
|
|
||
|
TEMPLATES[0]["OPTIONS"]["context_processors"] += [
|
||
|
'django.template.context_processors.debug'
|
||
|
]
|
||
|
|
||
|
|
||
|
# ---
|
||
|
# 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
|
||
|
# ---
|
||
|
|
||
|
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
|
||
|
|
||
|
INSTALLED_APPS += ["debug_toolbar"]
|
||
|
MIDDLEWARE_CLASSES += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
|
||
|
DEBUG_TOOLBAR_CONFIG = {
|
||
|
'SHOW_TOOLBAR_CALLBACK': show_toolbar,
|
||
|
}
|