]> git.0d.be Git - mandayejs.git/blob - mandayejs/settings.py
f579886c7168b20e97a3cd8dc3ecae9f440ba4e8
[mandayejs.git] / mandayejs / settings.py
1 # mandayejs - saml reverse proxy
2 # Copyright (C) 2015  Entr'ouvert
3 #
4 # This program is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published
6 # by the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 """
18 Django settings for mandayejs project.
19
20 For more information on this file, see
21 https://docs.djangoproject.com/en/1.7/topics/settings/
22
23 For the full list of settings and their values, see
24 https://docs.djangoproject.com/en/1.7/ref/settings/
25 """
26
27 from django.conf import global_settings
28
29 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
30 import os
31 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
32
33
34 # Quick-start development settings - unsuitable for production
35 # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
36
37 # SECURITY WARNING: keep the secret key used in production secret!
38 SECRET_KEY = 'xlf$@r5j*6p5-l#q=bg&t$mlhf=v@fq9^xfs#%712zndtu2#2@'
39
40 # SECURITY WARNING: don't run with debug turned on in production!
41 DEBUG = True
42
43 TEMPLATE_DEBUG = True
44
45 ALLOWED_HOSTS = []
46
47
48 # Application definition
49
50 INSTALLED_APPS = (
51     'django.contrib.admin',
52     'django.contrib.auth',
53     'django.contrib.contenttypes',
54     'django.contrib.sessions',
55     'django.contrib.messages',
56     'django.contrib.staticfiles',
57     'gadjo',
58 )
59
60 MIDDLEWARE_CLASSES = (
61     'django.contrib.sessions.middleware.SessionMiddleware',
62     'django.middleware.common.CommonMiddleware',
63     'django.middleware.csrf.CsrfViewMiddleware',
64     'django.contrib.auth.middleware.AuthenticationMiddleware',
65     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
66     'django.contrib.messages.middleware.MessageMiddleware',
67     'django.middleware.clickjacking.XFrameOptionsMiddleware',
68 )
69
70 ROOT_URLCONF = 'mandayejs.urls'
71
72 WSGI_APPLICATION = 'mandayejs.wsgi.application'
73
74
75 # Database
76 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
77
78 DATABASES = {
79     'default': {
80         'ENGINE': 'django.db.backends.sqlite3',
81         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
82     }
83 }
84
85 # Internationalization
86 # https://docs.djangoproject.com/en/1.7/topics/i18n/
87
88 LANGUAGE_CODE = 'en-us'
89
90 TIME_ZONE = 'UTC'
91
92 USE_I18N = True
93
94 USE_L10N = True
95
96 USE_TZ = True
97
98
99 # Static files (CSS, JavaScript, Images)
100 # https://docs.djangoproject.com/en/1.7/howto/static-files/
101
102 STATIC_URL = '/_mandaye/static/'
103
104 # Serve xstatic files, required for gadjo
105 STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + \
106             ('gadjo.finders.XStaticFinder',)
107
108 STATICFILES_DIRS = (
109     os.path.join(BASE_DIR, 'mandayejs', 'static'),
110 )
111
112 TEMPLATE_DIRS = (
113     os.path.join(BASE_DIR, 'mandayejs', 'templates'),
114 )
115
116 LOGIN_URL = 'auth_login'
117 LOGIN_REDIRECT_URL = 'post-login'
118
119 local_settings_file = os.environ.get('MANDAYEJS_SETTINGS_FILE',
120         os.path.join(os.path.dirname(__file__), 'local_settings.py'))
121 if os.path.exists(local_settings_file):
122     execfile(local_settings_file)