pong
[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
20SERVER_EMAIL = 'ne-pas-repondre@auf.org'
21EMAIL_SUBJECT_PREFIX = '[%s - %s] ' % (socket.gethostname(), PROJECT_PATH)
22ADMINS = () # pas de notifications courriel
23MANAGERS = ADMINS
24
25# Locales
26TIME_ZONE = 'America/Montreal'
27LANGUAGE_CODE = 'fr-ca'
28USE_I18N = True
29USE_L10N = True
30USE_TZ = True
31
32# URLs
33ROOT_URLCONF = '{{ project_name }}.urls'
34MEDIA_URL = '/media/'
35STATIC_URL = '/static/'
36
37INSTALLED_APPS = (
38 'django.contrib.auth',
39 'django.contrib.contenttypes',
40 'django.contrib.sessions',
41 'django.contrib.sites',
42 'django.contrib.messages',
43 'django.contrib.staticfiles',
44 'django.contrib.admin',
45 'south',
46 'raven.contrib.django',
7adc7f71 47 'auf.django.pong',
87a6b693
OL
48)
49
50TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_TEMPLATE_CONTEXT_PROCESSORS + (
51 'django.core.context_processors.static',
52 'django.core.context_processors.request',
53)
54
55MIDDLEWARE_CLASSES = DEFAULT_MIDDLEWARE_CLASSES + (
56 'auf.django.piwik.middleware.TrackMiddleware',
57)
58
59AUTHENTICATION_BACKENDS = (
60 'django.contrib.auth.backends.ModelBackend',
61)
62
63SOUTH_TESTS_MIGRATE = False
64
65LOGGING_FORMAT = \
66 '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
67LOGGING = {
68 'version': 1,
69 'disable_existing_loggers': False,
70 'filters': {
71 'require_debug_false': {
72 '()': 'django.utils.log.RequireDebugFalse'
73 }
74 },
75 'formatters': {
76 'verbose': {
77 'format': LOGGING_FORMAT
78 },
79 },
80 'handlers': {
81 'console': {
82 'level': 'DEBUG',
83 'class': 'logging.StreamHandler',
84 },
85 'sentry': {
86 'level': 'ERROR',
87 'filters': ['require_debug_false'],
88 'class': 'raven.contrib.django.handlers.SentryHandler',
89 },
90 },
91 'loggers': {
92 '': {
93 'handlers': ['console', 'sentry'],
94 'level': 'DEBUG',
95 'propagate': False,
96 },
97 }
98}
99
100try:
101 from local_settings import * # NOQA
102except ImportError:
103 pass