ajoute django-debug-toolbar aux requirements
pour simplifier les tests et debug futurs, sans avoir à connaitre la procédure d'installation d'un module Python dans un virtualenv...
This commit is contained in:
parent
1f0276300e
commit
3f836506a2
|
@ -0,0 +1,83 @@
|
|||
# Django local_settings for polynum project
|
||||
|
||||
# See settings.py for default values
|
||||
|
||||
DEBUG = True # set to False in production !
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
# use PostgreSQL in production
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
|
||||
'NAME': 'polynum', # Or path to database file if using sqlite3.
|
||||
'USER': 'polynum', # Not used with sqlite3.
|
||||
'PASSWORD': 'abcdef', # Not used with sqlite3.
|
||||
'HOST': 'db.univ.fr', # Set to empty string for localhost. Not used with sqlite3.
|
||||
'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Upload directory
|
||||
#
|
||||
DOCUMENTS_UPLOAD_DIRECTORY = '/opt/polynum/uploads/'
|
||||
|
||||
#
|
||||
# Authentification with CAS & LDAP
|
||||
#
|
||||
CAS_SERVER_URL = 'https://www.univ.fr/cas/' # CAS server URL, if empty CAS login is disabled
|
||||
LDAP_URL = 'ldaps://' # LDAP server URL
|
||||
LDAP_BIND_DN = '' # DN to authenticate to the LDAP server
|
||||
LDAP_BIND_PASSWORD = 'abdef' # and its password
|
||||
LDAP_USER_QUERY = '' # query to retrieve user, %s is the CAS username
|
||||
LDAP_BASE = '' # base DN for the query
|
||||
|
||||
#
|
||||
# Design
|
||||
#
|
||||
# grappelli admin -- see http://readthedocs.org/docs/django-grappelli
|
||||
GRAPPELLI_ADMIN_TITLE = 'Univ - Administration de PolyNum'
|
||||
# templates
|
||||
TEMPLATE_DIRS = (
|
||||
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
||||
# Always use forward slashes, even on Windows.
|
||||
# Don't forget to use absolute paths, not relative paths.
|
||||
'/opt/polynum/local/templates',
|
||||
'/opt/polynum/templates',
|
||||
)
|
||||
|
||||
#
|
||||
# OAI METADATA
|
||||
#
|
||||
OAI_ADMIN_EMAIL = 'admin@univ.fr'
|
||||
OAI_TEXT = 'Polynum documents'
|
||||
OAI_REPOSITORY_NAME = 'Polynum OAI-PMH repository'
|
||||
|
||||
#
|
||||
# Logging configuration
|
||||
# See http://docs.djangoproject.com/en/dev/topics/logging
|
||||
#
|
||||
LOGGING = {
|
||||
'version': 1,
|
||||
'disable_existing_loggers': False,
|
||||
'filters': {
|
||||
'require_debug_false': {
|
||||
'()': 'django.utils.log.RequireDebugFalse'
|
||||
}
|
||||
},
|
||||
'handlers': {
|
||||
'mail_admins': {
|
||||
'level': 'ERROR',
|
||||
'filters': ['require_debug_false'],
|
||||
'class': 'django.utils.log.AdminEmailHandler'
|
||||
}
|
||||
},
|
||||
'loggers': {
|
||||
'django.request': {
|
||||
'handlers': ['mail_admins'],
|
||||
'level': 'ERROR',
|
||||
'propagate': True,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ from django.core.urlresolvers import reverse_lazy
|
|||
|
||||
PROJECT_ROOT = os.path.join(os.path.dirname(__file__), '.')
|
||||
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
TEMPLATE_DEBUG = DEBUG
|
||||
|
||||
ADMINS = (
|
||||
|
@ -201,20 +201,21 @@ except:
|
|||
pass
|
||||
|
||||
# CAS
|
||||
|
||||
if CAS_SERVER_URL:
|
||||
AUTHENTICATION_BACKENDS += ( 'polynum.base.backends.CASBackend', )
|
||||
MIDDLEWARE_CLASSES += ( 'django_cas.middleware.CASMiddleware', )
|
||||
|
||||
DEBUG_TOOLBAR_CONFIG = {
|
||||
'INTERCEPT_REDIRECTS': False,
|
||||
}
|
||||
|
||||
LOGIN_REDIRECT_URL = reverse_lazy('list_request')
|
||||
|
||||
if DEBUG:
|
||||
MIDDLEWARE_CLASSES += (
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
)
|
||||
INSTALLED_APPS += (
|
||||
'debug_toolbar',
|
||||
'debug_toolbar',
|
||||
)
|
||||
DEBUG_TOOLBAR_CONFIG = {
|
||||
'INTERCEPT_REDIRECTS': False,
|
||||
}
|
||||
|
||||
|
|
|
@ -7,3 +7,4 @@ https://bitbucket.org/cpcc/django-cas/get/tip.tar.gz
|
|||
git+https://github.com/sehmaschine/django-grappelli@grappelli_2_4
|
||||
pypdf
|
||||
flup
|
||||
django-debug-toolbar
|
||||
|
|
Reference in New Issue