fix doc
[auf_skeleton_django.git] / project_name / settings / base.py
1 # -*- coding: utf-8 -*-
2
3 import os
4 import socket
5
6 from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as \
7 DEFAULT_TEMPLATE_CONTEXT_PROCESSORS
8 from django.conf.global_settings import MIDDLEWARE_CLASSES as \
9 DEFAULT_MIDDLEWARE_CLASSES
10
11
12 # Paths
13 SETTINGS_PATH = os.path.dirname(__file__)
14 PROJECT_PATH = os.path.dirname(SETTINGS_PATH)
15 ROOT_PATH = os.path.dirname(PROJECT_PATH)
16 MEDIA_ROOT = os.path.join(ROOT_PATH, 'media')
17 STATIC_ROOT = os.path.join(ROOT_PATH, 'sitestatic')
18
19 # Rapports d'erreurs
20 ADMINS = (
21 ('ARI', 'developpeurs@ca.auf.org'),
22 )
23 EMAIL_SUBJECT_PREFIX = '[%s - %s] ' % (socket.gethostname(), PROJECT_PATH)
24 ADMINS = () # pas de notifications courriel
25 MANAGERS = ADMINS
26
27 # Locales
28 TIME_ZONE = 'America/Montreal'
29 LANGUAGE_CODE = 'fr-ca'
30 USE_I18N = True
31 USE_L10N = True
32 USE_TZ = True
33
34 # URLs
35 ROOT_URLCONF = '{{ project_name }}.urls'
36 MEDIA_URL = '/media/'
37 STATIC_URL = '/static/'
38
39 INSTALLED_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',
47 '{{ project_name }}',
48 'south',
49 'raven.contrib.django',
50 'auf.django.pong',
51 )
52
53 TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_TEMPLATE_CONTEXT_PROCESSORS + (
54 'django.core.context_processors.static',
55 'django.core.context_processors.request',
56 )
57
58 MIDDLEWARE_CLASSES = DEFAULT_MIDDLEWARE_CLASSES + (
59 'auf.django.piwik.middleware.TrackMiddleware',
60 )
61
62 AUTHENTICATION_BACKENDS = (
63 'django.contrib.auth.backends.ModelBackend',
64 )
65
66 SOUTH_TESTS_MIGRATE = False
67
68 LOGGING_FORMAT = \
69 '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
70 LOGGING = {
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 },
93 'mail_admins': {
94 'level': 'ERROR',
95 'class': 'django.utils.log.AdminEmailHandler',
96 },
97 },
98 'loggers': {
99 '': {
100 'handlers': [
101 # si sentry ne resoud pas sentry.ca.auf.org
102 #'mail_admins',
103 'console',
104 'sentry',
105 ],
106 'level': 'DEBUG',
107 'propagate': False,
108 },
109 }
110 }
111
112 try:
113 from conf import * # NOQA
114 except ImportError:
115 pass