Projet

Général

Profil

Télécharger (3,33 ko) Statistiques
| Branche: | Tag: | Révision:

root / corbo / settings.py @ 78775031

1
"""
2
Django settings for corbo project.
3

    
4
For more information on this file, see
5
https://docs.djangoproject.com/en/1.7/topics/settings/
6

    
7
For the full list of settings and their values, see
8
https://docs.djangoproject.com/en/1.7/ref/settings/
9
"""
10

    
11
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
12
import os
13

    
14
from django.conf import global_settings
15

    
16
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
17

    
18
# Quick-start development settings - unsuitable for production
19
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
20

    
21
# SECURITY WARNING: keep the secret key used in production secret!
22
SECRET_KEY = '$%7m&rq1-&$c77a1s^_$=xgiqez-%_x3^&5=*^-4(6si2zu59z'
23

    
24
# SECURITY WARNING: don't run with debug turned on in production!
25
DEBUG = True
26

    
27
TEMPLATE_DEBUG = True
28

    
29
ALLOWED_HOSTS = []
30

    
31

    
32
# Application definition
33

    
34
INSTALLED_APPS = (
35
    'corbo',
36
    'ckeditor',
37
    'gadjo',
38
    'django.contrib.auth',
39
    'django.contrib.admin',
40
    'django.contrib.contenttypes',
41
    'django.contrib.sessions',
42
    'django.contrib.messages',
43
    'django.contrib.staticfiles',
44
    'rest_framework',
45
)
46

    
47
MIDDLEWARE_CLASSES = (
48
    'django.contrib.sessions.middleware.SessionMiddleware',
49
    'django.middleware.common.CommonMiddleware',
50
    'django.middleware.csrf.CsrfViewMiddleware',
51
    'django.contrib.auth.middleware.AuthenticationMiddleware',
52
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
53
    'django.contrib.messages.middleware.MessageMiddleware',
54
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
55
)
56

    
57
ROOT_URLCONF = 'corbo.urls'
58

    
59
WSGI_APPLICATION = 'corbo.wsgi.application'
60

    
61

    
62
# Database
63
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
64

    
65
DATABASES = {
66
    'default': {
67
        'ENGINE': 'django.db.backends.sqlite3',
68
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
69
    }
70
}
71

    
72
# Internationalization
73
# https://docs.djangoproject.com/en/1.7/topics/i18n/
74

    
75
LANGUAGE_CODE = 'en-us'
76

    
77
TIME_ZONE = 'UTC'
78

    
79
USE_I18N = True
80

    
81
USE_L10N = True
82

    
83
USE_TZ = True
84

    
85
STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + ('gadjo.finders.XStaticFinder',)
86

    
87

    
88
# Static files (CSS, JavaScript, Images)
89
# https://docs.djangoproject.com/en/1.7/howto/static-files/
90

    
91
STATIC_URL = '/static/'
92

    
93
STATIC_ROOT = 'static'
94

    
95
CKEDITOR_UPLOAD_PATH = 'ckeditor/uploads'
96

    
97
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
98
MEDIA_URL = '/media/'
99

    
100
ANNOUNCES_PER_PAGE = 20
101

    
102
RSS_TITLE = 'Announces'
103
RSS_DESCRIPTION = ''
104
RSS_LINK = ''
105
RSS_LINK_TEMPLATE = '/#announce{0}'
106

    
107
# default mass emails expeditor
108
CORBO_DEFAULT_FROM_EMAIL = 'webmaster@localhost'
109

    
110

    
111
# Authentication settings
112
try:
113
    import mellon
114
except ImportError:
115
    mellon = None
116

    
117
if mellon is not None:
118
    AUTHENTICATION_BACKENDS = (
119
        'mellon.backends.SAMLBackend',
120
        'django.contrib.auth.backends.ModelBackend',
121
    )
122

    
123
LOGIN_URL = '/login/'
124
LOGIN_REDIRECT_URL = '/'
125
LOGOUT_URL = '/logout/'
126

    
127
MELLON_ATTRIBUTE_MAPPING = {
128
    'email': '{attributes[email][0]}',
129
    'first_name': '{attributes[first_name][0]}',
130
    'last_name': '{attributes[last_name][0]}',
131
}
132

    
133
MELLON_SUPERUSER_MAPPING = {
134
    'is_superuser': 'true',
135
}
136

    
137
MELLON_USERNAME_TEMPLATE = '{attributes[name_id_content]}'
138

    
139
MELLON_IDENTITY_PROVIDERS = []
140

    
141
local_settings_file = os.environ.get('CORBO_SETTINGS_FILE',
142
        os.path.join(os.path.dirname(__file__), 'local_settings.py'))
143
if os.path.exists(local_settings_file):
144
    execfile(local_settings_file)
(7-7/11)