-SERVER_EMAIL et log mail_admins de setup mais non actif
[auf_skeleton_django.git] / project_name / settings / base.py
CommitLineData
87a6b693
OL
1# -*- coding: utf-8 -*-
2
3import os
4import socket
5
6from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as \
7 DEFAULT_TEMPLATE_CONTEXT_PROCESSORS
8from django.conf.global_settings import MIDDLEWARE_CLASSES as \
9 DEFAULT_MIDDLEWARE_CLASSES
10
11
12# Paths
13SETTINGS_PATH = os.path.dirname(__file__)
14PROJECT_PATH = os.path.dirname(SETTINGS_PATH)
15ROOT_PATH = os.path.dirname(PROJECT_PATH)
16MEDIA_ROOT = os.path.join(ROOT_PATH, 'media')
17STATIC_ROOT = os.path.join(ROOT_PATH, 'sitestatic')
18
19# Rapports d'erreurs
8f18341c
OL
20ADMINS = (
21 ('ARI', 'developpeurs@ca.auf.org'),
22)
87a6b693
OL
23EMAIL_SUBJECT_PREFIX = '[%s - %s] ' % (socket.gethostname(), PROJECT_PATH)
24ADMINS = () # pas de notifications courriel
25MANAGERS = ADMINS
26
27# Locales
28TIME_ZONE = 'America/Montreal'
29LANGUAGE_CODE = 'fr-ca'
30USE_I18N = True
31USE_L10N = True
32USE_TZ = True
33
34# URLs
35ROOT_URLCONF = '{{ project_name }}.urls'
36MEDIA_URL = '/media/'
37STATIC_URL = '/static/'
38
39INSTALLED_APPS = (
40 'django.contrib.auth',
41 'django.contrib.contenttypes',
42 'django.contrib.sessions',
43 'django.contrib.sites',
44 'django.contrib.messages',
45 'django.contrib.staticfiles',
46 'django.contrib.admin',
e5cceae7 47 '{{ project_name }}',
87a6b693
OL
48 'south',
49 'raven.contrib.django',
7adc7f71 50 'auf.django.pong',
87a6b693
OL
51)
52
53TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_TEMPLATE_CONTEXT_PROCESSORS + (
54 'django.core.context_processors.static',
55 'django.core.context_processors.request',
56)
57
58MIDDLEWARE_CLASSES = DEFAULT_MIDDLEWARE_CLASSES + (
59 'auf.django.piwik.middleware.TrackMiddleware',
60)
61
62AUTHENTICATION_BACKENDS = (
63 'django.contrib.auth.backends.ModelBackend',
64)
65
66SOUTH_TESTS_MIGRATE = False
67
68LOGGING_FORMAT = \
69 '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
70LOGGING = {
71 'version': 1,
72 'disable_existing_loggers': False,
73 'filters': {
74 'require_debug_false': {
75 '()': 'django.utils.log.RequireDebugFalse'
76 }
77 },
78 'formatters': {
79 'verbose': {
80 'format': LOGGING_FORMAT
81 },
82 },
83 'handlers': {
84 'console': {
85 'level': 'DEBUG',
86 'class': 'logging.StreamHandler',
87 },
88 'sentry': {
89 'level': 'ERROR',
90 'filters': ['require_debug_false'],
91 'class': 'raven.contrib.django.handlers.SentryHandler',
92 },
8f18341c
OL
93 'mail_admins': {
94 'level': 'ERROR',
95 'class': 'django.utils.log.AdminEmailHandler',
96 },
87a6b693
OL
97 },
98 'loggers': {
99 '': {
8f18341c
OL
100 'handlers': [
101 # si sentry ne résoud pas sentry.ca.auf.org
102 #'mail_admins',
103 'console',
104 'sentry',
105 ],
87a6b693
OL
106 'level': 'DEBUG',
107 'propagate': False,
108 },
109 }
110}
111
112try:
e5cceae7 113 from conf import * # NOQA
87a6b693
OL
114except ImportError:
115 pass