sys.dont_write_bytecode = True
-DEBUG = True if os.environ.get('DEBUG') == 'True' else False
+DEBUG_ENV = os.environ.get('DEBUG') == 'True'
+DEBUG = DEBUG_ENV
TEMPLATE_DEBUG = DEBUG
)),
)
-
-MIDDLEWARE = (
+MIDDLEWARE = (('debug_toolbar.middleware.DebugToolbarMiddleware',) if DEBUG_ENV else []) + (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
)
+if DEBUG_ENV:
+ INSTALLED_APPS += ('debug_toolbar',)
+
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
DEFAULT_FROM_EMAIL = 'crfpa@pre-barreau.com'
SERVER_EMAIL = 'crfpa@pre-barreau.com'
EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION + '] '
+if DEBUG_ENV:
+ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+
+
POSTMAN_AUTO_MODERATE_AS = True
POSTMAN_DISALLOW_ANONYMOUS = True
#THUMBNAIL_FORCE_OVERWRITE = True
ALLOWED_HOSTS = ['localhost', 'crfpa.dockdev.pilotsystems.net']
+
+if DEBUG_ENV:
+ def show_toolbar(request):
+ return True
+ DEBUG_TOOLBAR_CONFIG = {
+ "SHOW_TOOLBAR_CALLBACK" : show_toolbar,
+ }
# -*- coding: utf-8 -*-
-from django.http import HttpResponse
+import os
+
+import debug_toolbar
from django.conf.urls import include, url
-from django.views.i18n import JavaScriptCatalog
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
+from django.http import HttpResponse
+from django.views.i18n import JavaScriptCatalog
+
admin.autodiscover()
js_info_dict = ['teleforma']
+DEBUG_ENV = os.environ.get('DEBUG') == 'True'
+
urlpatterns = [
# Example:
# (r'^sandbox/', include('sandbox.foo.urls')),
url(r'^pdfannotator/', include('pdfannotator.urls')),
url(r'^captcha/', include('captcha.urls')),
url(r'^messages/', include('postman.urls', namespace='postman')),
-]
+] + ([url(r'^__debug__/', include(debug_toolbar.urls)),] if DEBUG_ENV else [])
+