]> git.0d.be Git - mandayejs.git/blob - mandayejs/settings.py
move templates and static files to app
[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     'mandayejs.mandaye',
58     'gadjo',
59 )
60
61 MIDDLEWARE_CLASSES = (
62     'django.contrib.sessions.middleware.SessionMiddleware',
63     'django.middleware.common.CommonMiddleware',
64     'django.middleware.csrf.CsrfViewMiddleware',
65     'django.contrib.auth.middleware.AuthenticationMiddleware',
66     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
67     'django.contrib.messages.middleware.MessageMiddleware',
68     'django.middleware.clickjacking.XFrameOptionsMiddleware',
69 )
70
71 ROOT_URLCONF = 'mandayejs.urls'
72
73 WSGI_APPLICATION = 'mandayejs.wsgi.application'
74
75
76 # Database
77 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
78
79 DATABASES = {
80     'default': {
81         'ENGINE': 'django.db.backends.sqlite3',
82         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
83     }
84 }
85
86 # Internationalization
87 # https://docs.djangoproject.com/en/1.7/topics/i18n/
88
89 LANGUAGE_CODE = 'en-us'
90
91 TIME_ZONE = 'UTC'
92
93 USE_I18N = True
94
95 USE_L10N = True
96
97 USE_TZ = True
98
99
100 # Static files (CSS, JavaScript, Images)
101 # https://docs.djangoproject.com/en/1.7/howto/static-files/
102
103 STATIC_URL = '/_mandaye/static/'
104
105 # Serve xstatic files, required for gadjo
106 STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + \
107             ('gadjo.finders.XStaticFinder',)
108
109 LOGIN_URL = 'auth_login'
110 LOGIN_REDIRECT_URL = 'post-login'
111
112 local_settings_file = os.environ.get('MANDAYEJS_SETTINGS_FILE',
113         os.path.join(os.path.dirname(__file__), 'local_settings.py'))
114 if os.path.exists(local_settings_file):
115     execfile(local_settings_file)