| author | cavaliet |
| Mon, 09 Dec 2013 12:12:25 +0100 | |
| changeset 221 | 53b545f29189 |
| parent 175 | 7331ecc46cba |
| child 275 | 7fb704ee75e7 |
| permissions | -rw-r--r-- |
| 67 | 1 |
# -*- coding: utf-8 -*- |
| 0 | 2 |
# Django settings for jocondelab project. |
3 |
||
4 |
DEBUG = True |
|
5 |
TEMPLATE_DEBUG = DEBUG |
|
6 |
||
7 |
ADMINS = ( |
|
8 |
# ('Your Name', 'your_email@example.com'), |
|
9 |
) |
|
10 |
||
11 |
MANAGERS = ADMINS |
|
12 |
||
13 |
DATABASES = { |
|
14 |
'default': { |
|
15 |
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. |
|
16 |
'NAME': '', # Or path to database file if using sqlite3. |
|
17 |
# The following settings are not used with sqlite3: |
|
18 |
'USER': '', |
|
19 |
'PASSWORD': '', |
|
20 |
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. |
|
21 |
'PORT': '', # Set to empty string for default. |
|
22 |
} |
|
23 |
} |
|
24 |
||
25 |
# Hosts/domain names that are valid for this site; required if DEBUG is False |
|
26 |
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts |
|
27 |
ALLOWED_HOSTS = [] |
|
28 |
||
29 |
# Local time zone for this installation. Choices can be found here: |
|
30 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
31 |
# although not all choices may be available on all operating systems. |
|
32 |
# In a Windows environment this must be set to your system time zone. |
|
33 |
TIME_ZONE = 'Europe/Paris' |
|
34 |
||
35 |
# Language code for this installation. All choices can be found here: |
|
36 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
|
37 |
LANGUAGE_CODE = 'fr-fr' |
|
38 |
||
39 |
ugettext = lambda s: s |
|
40 |
||
41 |
LANGUAGES = ( |
|
42 |
('fr', ugettext('French')), |
|
| 86 | 43 |
('en', ugettext('English')), |
| 106 | 44 |
('it', ugettext('Italian')), |
45 |
('es', ugettext('Spanish')), |
|
46 |
('de', ugettext('German')), |
|
47 |
('pt', ugettext('Portuguese')), |
|
48 |
('ar', ugettext('Arabic')), |
|
| 110 | 49 |
('ru', ugettext('Russian')), |
| 106 | 50 |
('zh-cn', ugettext('Chinese')), |
51 |
('ja', ugettext('Japanese')), |
|
52 |
('ca', ugettext('Catalan')), |
|
53 |
('eu', ugettext('Basque')), |
|
54 |
('br', ugettext('Breton')), |
|
| 124 | 55 |
('oc', ugettext('Occitan')), |
| 0 | 56 |
) |
57 |
||
58 |
||
59 |
SITE_ID = 1 |
|
60 |
||
61 |
# If you set this to False, Django will make some optimizations so as not |
|
62 |
# to load the internationalization machinery. |
|
63 |
USE_I18N = True |
|
64 |
||
65 |
# If you set this to False, Django will not format dates, numbers and |
|
66 |
# calendars according to the current locale. |
|
67 |
USE_L10N = True |
|
68 |
||
69 |
# If you set this to False, Django will not use timezone-aware datetimes. |
|
70 |
USE_TZ = True |
|
71 |
||
72 |
# Absolute filesystem path to the directory that will hold user-uploaded files. |
|
73 |
# Example: "/var/www/example.com/media/" |
|
74 |
MEDIA_ROOT = '' |
|
75 |
||
76 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
77 |
# trailing slash. |
|
78 |
# Examples: "http://example.com/media/", "http://media.example.com/" |
|
79 |
MEDIA_URL = '' |
|
80 |
||
81 |
# Absolute path to the directory static files should be collected to. |
|
82 |
# Don't put anything in this directory yourself; store your static files |
|
83 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
|
84 |
# Example: "/var/www/example.com/static/" |
|
85 |
STATIC_ROOT = '' |
|
86 |
||
87 |
# URL prefix for static files. |
|
88 |
# Example: "http://example.com/static/", "http://static.example.com/" |
|
89 |
STATIC_URL = '/static/' |
|
90 |
||
91 |
# Additional locations of static files |
|
92 |
STATICFILES_DIRS = ( |
|
93 |
# Put strings here, like "/home/html/static" or "C:/www/django/static". |
|
94 |
# Always use forward slashes, even on Windows. |
|
95 |
# Don't forget to use absolute paths, not relative paths. |
|
96 |
) |
|
97 |
||
98 |
# List of finder classes that know how to find static files in |
|
99 |
# various locations. |
|
100 |
STATICFILES_FINDERS = ( |
|
101 |
'django.contrib.staticfiles.finders.FileSystemFinder', |
|
102 |
'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
|
103 |
# 'django.contrib.staticfiles.finders.DefaultStorageFinder', |
|
104 |
) |
|
105 |
||
106 |
# Make this unique, and don't share it with anybody. |
|
107 |
SECRET_KEY = '' |
|
108 |
||
109 |
# List of callables that know how to import templates from various sources. |
|
110 |
TEMPLATE_LOADERS = ( |
|
111 |
'django.template.loaders.filesystem.Loader', |
|
112 |
'django.template.loaders.app_directories.Loader', |
|
113 |
# 'django.template.loaders.eggs.Loader', |
|
114 |
) |
|
115 |
||
116 |
MIDDLEWARE_CLASSES = ( |
|
117 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
| 22 | 118 |
'django.middleware.locale.LocaleMiddleware', |
119 |
'django.middleware.common.CommonMiddleware', |
|
| 0 | 120 |
'django.middleware.csrf.CsrfViewMiddleware', |
121 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
122 |
'django.contrib.messages.middleware.MessageMiddleware', |
|
123 |
# Uncomment the next line for simple clickjacking protection: |
|
124 |
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
125 |
) |
|
126 |
||
127 |
ROOT_URLCONF = 'jocondelab.urls' |
|
128 |
||
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
129 |
AUTH_USER_MODEL = 'core.User' |
| 0 | 130 |
INITIAL_CUSTOM_USER_MIGRATION = "0001_initial" |
131 |
||
132 |
# Python dotted path to the WSGI application used by Django's runserver. |
|
133 |
WSGI_APPLICATION = 'jocondelab.wsgi.application' |
|
134 |
||
135 |
TEMPLATE_DIRS = ( |
|
136 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
137 |
# Always use forward slashes, even on Windows. |
|
138 |
# Don't forget to use absolute paths, not relative paths. |
|
139 |
) |
|
140 |
||
141 |
# List of processors used by RequestContext to populate the context. |
|
142 |
# Each one should be a callable that takes the request object as its |
|
143 |
# only parameter and returns a dictionary to add to the context. |
|
144 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
|
145 |
"django.contrib.auth.context_processors.auth", |
|
146 |
"django.core.context_processors.debug", |
|
147 |
"django.core.context_processors.i18n", |
|
148 |
"django.core.context_processors.media", |
|
149 |
"django.core.context_processors.static", |
|
150 |
"django.core.context_processors.tz", |
|
151 |
'django.core.context_processors.request', |
|
152 |
"django.contrib.messages.context_processors.messages", |
|
153 |
"jocondelab.context_processors.version" |
|
154 |
) |
|
155 |
||
156 |
INSTALLED_APPS = ( |
|
157 |
'django.contrib.auth', |
|
158 |
'django.contrib.contenttypes', |
|
159 |
'django.contrib.sessions', |
|
160 |
'django.contrib.sites', |
|
161 |
'django.contrib.messages', |
|
162 |
'django.contrib.staticfiles', |
|
163 |
'django_extensions', |
|
|
61
0048668779c0
change model for thesaurus tree. show level and ancestor
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
164 |
'django.contrib.admin', |
| 0 | 165 |
'south', |
|
61
0048668779c0
change model for thesaurus tree. show level and ancestor
ymh <ymh.work@gmail.com>
parents:
57
diff
changeset
|
166 |
'mptt', |
| 0 | 167 |
'core', |
168 |
'jocondelab', |
|
169 |
) |
|
170 |
||
171 |
# A sample logging configuration. The only tangible logging |
|
172 |
# performed by this configuration is to send an email to |
|
173 |
# the site admins on every HTTP 500 error when DEBUG=False. |
|
174 |
# See http://docs.djangoproject.com/en/dev/topics/logging for |
|
175 |
# more details on how to customize your logging configuration. |
|
176 |
LOGGING = { |
|
177 |
'version': 1, |
|
178 |
'disable_existing_loggers': False, |
|
179 |
'filters': { |
|
180 |
'require_debug_false': { |
|
181 |
'()': 'django.utils.log.RequireDebugFalse' |
|
182 |
} |
|
183 |
}, |
|
184 |
'handlers': { |
|
185 |
'mail_admins': { |
|
186 |
'level': 'ERROR', |
|
187 |
'filters': ['require_debug_false'], |
|
188 |
'class': 'django.utils.log.AdminEmailHandler' |
|
189 |
} |
|
190 |
}, |
|
191 |
'loggers': { |
|
192 |
'django.request': { |
|
193 |
'handlers': ['mail_admins'], |
|
194 |
'level': 'ERROR', |
|
195 |
'propagate': True, |
|
196 |
}, |
|
197 |
} |
|
198 |
} |
|
199 |
||
| 67 | 200 |
WIKIPEDIA_URLS = { |
201 |
'fr': { |
|
202 |
'base_url': "http://fr.wikipedia.org", |
|
203 |
'page_url': "http://fr.wikipedia.org/wiki", |
|
204 |
'api_url': "http://fr.wikipedia.org/w/api.php", |
|
205 |
'permalink_tmpl': "http://fr.wikipedia.org/w/index.php?oldid=%s", |
|
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
206 |
'dbpedia_base_url' : "http://fr.dbpedia.org", |
| 67 | 207 |
'dbpedia_uri' : "http://fr.dbpedia.org/resource/%s", |
208 |
'dbpedia_sparql_url' : "http://fr.dbpedia.org/sparql", |
|
209 |
'dbpedia_sparql_use_proxy': False, |
|
210 |
'disambiguation_cat' : u'Catégorie:Homonymie', |
|
211 |
}, |
|
212 |
'en': { |
|
213 |
'base_url': "http://en.wikipedia.org", |
|
214 |
'page_url': "http://en.wikipedia.org/wiki", |
|
215 |
'api_url': "http://en.wikipedia.org/w/api.php", |
|
216 |
'permalink_tmpl': "http://en.wikipedia.org/w/index.php?oldid=%s", |
|
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
217 |
'dbpedia_base_url' : "http://dbpedia.org", |
| 67 | 218 |
'dbpedia_uri' : "http://dbpedia.org/resource/%s", |
219 |
'dbpedia_sparql_url' : "http://dbpedia.org/sparql", |
|
220 |
'dbpedia_sparql_use_proxy': False, |
|
221 |
'disambiguation_cat' : u'Category:Disambiguation pages', |
|
222 |
}, |
|
223 |
'it': { |
|
224 |
'base_url': "http://it.wikipedia.org", |
|
225 |
'page_url': "http://it.wikipedia.org/wiki", |
|
226 |
'api_url': "http://it.wikipedia.org/w/api.php", |
|
227 |
'permalink_tmpl': "http://it.wikipedia.org/w/index.php?oldid=%s", |
|
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
228 |
'dbpedia_base_url' : "http://it.dbpedia.org", |
| 67 | 229 |
'dbpedia_uri' : "http://it.dbpedia.org/resource/%s", |
230 |
'dbpedia_sparql_url' : "http://it.dbpedia.org/sparql", |
|
231 |
'dbpedia_sparql_use_proxy': True, |
|
232 |
'disambiguation_cat' : u'Categoria:Disambigua', |
|
233 |
}, |
|
234 |
'de': { |
|
235 |
'base_url': "http://de.wikipedia.org", |
|
236 |
'page_url': "http://de.wikipedia.org/wiki", |
|
237 |
'api_url': "http://de.wikipedia.org/w/api.php", |
|
238 |
'permalink_tmpl': "http://de.wikipedia.org/w/index.php?oldid=%s", |
|
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
239 |
'dbpedia_base_url' : "http://de.dbpedia.org", |
| 67 | 240 |
'dbpedia_uri' : "http://de.dbpedia.org/resource/%s", |
241 |
'dbpedia_sparql_url' : "http://de.dbpedia.org/sparql", |
|
242 |
'dbpedia_sparql_use_proxy': True, |
|
243 |
'disambiguation_cat' : u'Kategorie:Begriffsklärung', |
|
244 |
}, |
|
245 |
'ja': { |
|
246 |
'base_url': "http://ja.wikipedia.org", |
|
247 |
'page_url': "http://ja.wikipedia.org/wiki", |
|
248 |
'api_url': "http://ja.wikipedia.org/w/api.php", |
|
249 |
'permalink_tmpl': "http://ja.wikipedia.org/w/index.php?oldid=%s", |
|
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
250 |
'dbpedia_base_url' : "http://ja.dbpedia.org", |
| 67 | 251 |
'dbpedia_uri' : "http://ja.dbpedia.org/resource/%s", |
252 |
'dbpedia_sparql_url' : "http://ja.dbpedia.org/sparql", |
|
253 |
'dbpedia_sparql_use_proxy': False, |
|
254 |
'disambiguation_cat' : u'カテゴリ:同名の地名', |
|
255 |
}, |
|
256 |
} |
|
257 |
||
| 175 | 258 |
JOCONDE_IMAGE_BASE_URL = "http://www.culture.gouv.fr/Wave/image/joconde" |
|
57
a82c3913c1fc
add direct link to notice on ref field
ymh <ymh.work@gmail.com>
parents:
55
diff
changeset
|
259 |
JOCONDE_NOTICE_BASE_URL = "http://www.culture.gouv.fr/public/mistral/joconde_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98=" |
|
62
33fd91a414cc
selection dialog for thesaurus tree
ymh <ymh.work@gmail.com>
parents:
61
diff
changeset
|
260 |
JOCONDE_TERM_TREE_MAX_CHILDREN = 50 |
|
33fd91a414cc
selection dialog for thesaurus tree
ymh <ymh.work@gmail.com>
parents:
61
diff
changeset
|
261 |
JOCONDE_TERM_TREE_MAX_ROOT_NODE = 300 |
| 0 | 262 |
|
| 5 | 263 |
TERM_LIST_PAGE_SIZE = 20 |
|
20
ec738ea574a7
improve pagination add total nb to request
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
264 |
PAGINATOR_VISIBLE_RANGE = 5 |
| 171 | 265 |
# 24 hours DB_QUERY_CACHE_TIME |
266 |
DB_QUERY_CACHE_TIME = 86400 |
|
| 0 | 267 |
|
|
91
3bbf7371378a
Model reorganization for user + migration.
ymh <ymh.work@gmail.com>
parents:
67
diff
changeset
|
268 |
from config import * # @UnusedWildImport |
| 0 | 269 |
|
270 |
if not "SRC_BASE_URL" in locals(): |
|
271 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
|
272 |
if not "LOGIN_URL" in locals(): |
|
273 |
LOGIN_URL = SRC_BASE_URL + 'auth/login/' |
|
274 |