1 | # -*- coding: utf-8 -*-␊ |
2 | """␊ |
3 | Copyright 2015 Grégory Soutadé␊ |
4 | ␊ |
5 | This file is part of Dénote.␊ |
6 | ␊ |
7 | Dénote is free software: you can redistribute it and/or modify␊ |
8 | it under the terms of the GNU General Public License as published by␊ |
9 | the Free Software Foundation, either version 3 of the License, or␊ |
10 | (at your option) any later version.␊ |
11 | ␊ |
12 | Dénote is distributed in the hope that it will be useful,␊ |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of␊ |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the␊ |
15 | GNU General Public License for more details.␊ |
16 | ␊ |
17 | You should have received a copy of the GNU General Public License␊ |
18 | along with Dénote. If not, see <http://www.gnu.org/licenses/>.␊ |
19 | """␊ |
20 | ␊ |
21 | # Django settings for denote project.␊ |
22 | ␊ |
23 | import os␊ |
24 | ␊ |
25 | DEBUG = True␊ |
26 | TEMPLATE_DEBUG = DEBUG␊ |
27 | ␊ |
28 | if not 'DENOTE_ROOT' in os.environ:␊ |
29 | # manage.py␊ |
30 | denote_root = os.getcwd() + '/denote/'␊ |
31 | else:␊ |
32 | # Apache␊ |
33 | denote_root = os.environ['DENOTE_ROOT']␊ |
34 | ␊ |
35 | ADMINS = (␊ |
36 | ('Gregory Soutade', 'gregory@soutade.fr'),␊ |
37 | )␊ |
38 | ␊ |
39 | MANAGERS = ADMINS␊ |
40 | ␊ |
41 | DATABASES = {␊ |
42 | 'default': {␊ |
43 | 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.␊ |
44 | 'NAME': denote_root + 'denote.db', # Or path to database file if using sqlite3.␊ |
45 | # The following settings are not used with sqlite3:␊ |
46 | 'USER': '',␊ |
47 | 'PASSWORD': '',␊ |
48 | 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.␊ |
49 | 'PORT': '', # Set to empty string for default.␊ |
50 | }␊ |
51 | }␊ |
52 | ␊ |
53 | # Hosts/domain names that are valid for this site; required if DEBUG is False␊ |
54 | # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts␊ |
55 | ALLOWED_HOSTS = []␊ |
56 | ␊ |
57 | # Local time zone for this installation. Choices can be found here:␊ |
58 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name␊ |
59 | # although not all choices may be available on all operating systems.␊ |
60 | # In a Windows environment this must be set to your system time zone.␊ |
61 | TIME_ZONE = 'Europe/Paris'␊ |
62 | ␊ |
63 | # Language code for this installation. All choices can be found here:␊ |
64 | # http://www.i18nguy.com/unicode/language-identifiers.html␊ |
65 | LANGUAGE_CODE = 'en-us'␊ |
66 | ␊ |
67 | SITE_ID = 1␊ |
68 | ␊ |
69 | # If you set this to False, Django will make some optimizations so as not␊ |
70 | # to load the internationalization machinery.␊ |
71 | USE_I18N = True␊ |
72 | ␊ |
73 | # If you set this to False, Django will not format dates, numbers and␊ |
74 | # calendars according to the current locale.␊ |
75 | USE_L10N = True␊ |
76 | ␊ |
77 | # If you set this to False, Django will not use timezone-aware datetimes.␊ |
78 | USE_TZ = True␊ |
79 | ␊ |
80 | # Absolute filesystem path to the directory that will hold user-uploaded files.␊ |
81 | # Example: "/var/www/example.com/media/"␊ |
82 | MEDIA_ROOT = ''␊ |
83 | ␊ |
84 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a␊ |
85 | # trailing slash.␊ |
86 | # Examples: "http://example.com/media/", "http://media.example.com/"␊ |
87 | MEDIA_URL = ''␊ |
88 | ␊ |
89 | # Absolute path to the directory static files should be collected to.␊ |
90 | # Don't put anything in this directory yourself; store your static files␊ |
91 | # in apps' "static/" subdirectories and in STATICFILES_DIRS.␊ |
92 | # Example: "/var/www/example.com/static/"␊ |
93 | STATIC_ROOT = ''␊ |
94 | ␊ |
95 | # URL prefix for static files.␊ |
96 | # Example: "http://example.com/static/", "http://static.example.com/"␊ |
97 | STATIC_URL = '/static/'␊ |
98 | ␊ |
99 | # Additional locations of static files␊ |
100 | STATICFILES_DIRS = (␊ |
101 | '/home/soutade/www/denote/denote/denote/static',␊ |
102 | # Put strings here, like "/home/html/static" or "C:/www/django/static".␊ |
103 | # Always use forward slashes, even on Windows.␊ |
104 | # Don't forget to use absolute paths, not relative paths.␊ |
105 | )␊ |
106 | ␊ |
107 | # List of finder classes that know how to find static files in␊ |
108 | # various locations.␊ |
109 | STATICFILES_FINDERS = (␊ |
110 | 'django.contrib.staticfiles.finders.FileSystemFinder',␊ |
111 | 'django.contrib.staticfiles.finders.AppDirectoriesFinder',␊ |
112 | # 'django.contrib.staticfiles.finders.DefaultStorageFinder',␊ |
113 | )␊ |
114 | ␊ |
115 | # Make this unique, and don't share it with anybody.␊ |
116 | SECRET_KEY = 'yls+affgv5i=2%no4xcbo8+0dmugw$a)erye=r94&=c8coc3g!'␊ |
117 | ␊ |
118 | # List of callables that know how to import templates from various sources.␊ |
119 | TEMPLATE_LOADERS = (␊ |
120 | 'django.template.loaders.filesystem.Loader',␊ |
121 | 'django.template.loaders.app_directories.Loader',␊ |
122 | # 'django.template.loaders.eggs.Loader',␊ |
123 | )␊ |
124 | ␊ |
125 | MIDDLEWARE_CLASSES = (␊ |
126 | 'django.middleware.common.CommonMiddleware',␊ |
127 | 'django.contrib.sessions.middleware.SessionMiddleware',␊ |
128 | 'django.middleware.csrf.CsrfViewMiddleware',␊ |
129 | 'django.contrib.auth.middleware.AuthenticationMiddleware',␊ |
130 | 'django.contrib.messages.middleware.MessageMiddleware',␊ |
131 | # Uncomment the next line for simple clickjacking protection:␊ |
132 | # 'django.middleware.clickjacking.XFrameOptionsMiddleware',␊ |
133 | )␊ |
134 | ␊ |
135 | ROOT_URLCONF = 'denote.urls'␊ |
136 | ␊ |
137 | # Python dotted path to the WSGI application used by Django's runserver.␊ |
138 | WSGI_APPLICATION = 'denote.wsgi.application'␊ |
139 | ␊ |
140 | TEMPLATE_DIRS = (␊ |
141 | # denote_root,␊ |
142 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".␊ |
143 | # Always use forward slashes, even on Windows.␊ |
144 | # Don't forget to use absolute paths, not relative paths.␊ |
145 | )␊ |
146 | ␊ |
147 | INSTALLED_APPS = (␊ |
148 | 'django.contrib.auth',␊ |
149 | 'django.contrib.contenttypes',␊ |
150 | 'django.contrib.sessions',␊ |
151 | 'django.contrib.sites',␊ |
152 | 'django.contrib.messages',␊ |
153 | 'django.contrib.staticfiles',␊ |
154 | 'denote'␊ |
155 | # Uncomment the next line to enable the admin:␊ |
156 | # 'django.contrib.admin',␊ |
157 | # Uncomment the next line to enable admin documentation:␊ |
158 | # 'django.contrib.admindocs',␊ |
159 | )␊ |
160 | ␊ |
161 | SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'␊ |
162 | ␊ |
163 | # A sample logging configuration. The only tangible logging␊ |
164 | # performed by this configuration is to send an email to␊ |
165 | # the site admins on every HTTP 500 error when DEBUG=False.␊ |
166 | # See http://docs.djangoproject.com/en/dev/topics/logging for␊ |
167 | # more details on how to customize your logging configuration.␊ |
168 | LOGGING = {␊ |
169 | 'version': 1,␊ |
170 | 'disable_existing_loggers': False,␊ |
171 | 'filters': {␊ |
172 | 'require_debug_false': {␊ |
173 | '()': 'django.utils.log.RequireDebugFalse'␊ |
174 | }␊ |
175 | },␊ |
176 | 'handlers': {␊ |
177 | 'mail_admins': {␊ |
178 | 'level': 'ERROR',␊ |
179 | 'filters': ['require_debug_false'],␊ |
180 | 'class': 'django.utils.log.AdminEmailHandler'␊ |
181 | }␊ |
182 | },␊ |
183 | 'loggers': {␊ |
184 | 'django.request': {␊ |
185 | 'handlers': ['mail_admins'],␊ |
186 | 'level': 'ERROR',␊ |
187 | 'propagate': True,␊ |
188 | },␊ |
189 | }␊ |
190 | }␊ |
191 | ␊ |
192 | AUTH_USER_MODEL = "denote.User"␊ |