322
|
1 |
# -*- coding: utf-8 -*- |
|
2 |
#@PydevCodeAnalysisIgnore |
|
3 |
import os.path |
|
4 |
import ldtplatform |
|
5 |
# Django settings for project. |
|
6 |
|
|
7 |
DEBUG = True |
|
8 |
TEMPLATE_DEBUG = DEBUG |
|
9 |
|
|
10 |
ADMINS = ( |
|
11 |
# ('Your Name', 'your_email@domain.com'), |
|
12 |
) |
|
13 |
|
|
14 |
MANAGERS = ADMINS |
|
15 |
|
|
16 |
DATABASES = { |
|
17 |
'default': { |
|
18 |
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
19 |
'NAME': '', # Or path to database file if using sqlite3. |
|
20 |
'USER': '', # Not used with sqlite3. |
|
21 |
'PASSWORD': '', # Not used with sqlite3. |
|
22 |
'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
|
23 |
'PORT': '', # Set to empty string for default. Not used with sqlite3. |
|
24 |
} |
|
25 |
} |
|
26 |
|
|
27 |
# Local time zone for this installation. Choices can be found here: |
|
28 |
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
29 |
# although not all choices may be available on all operating systems. |
|
30 |
# If running in a Windows environment this must be set to the same as your |
|
31 |
# system time zone. |
|
32 |
TIME_ZONE = 'UTC' |
|
33 |
|
|
34 |
# Language code for this installation. All choices can be found here: |
|
35 |
# http://www.i18nguy.com/unicode/language-identifiers.html |
|
36 |
LANGUAGE_CODE = 'fr-fr' |
|
37 |
|
|
38 |
ugettext = lambda s: s |
|
39 |
|
|
40 |
LANGUAGES = ( |
|
41 |
('fr', ugettext('French')), |
|
42 |
('en', ugettext('English')), |
|
43 |
('ja', ugettext('Japanese')), |
|
44 |
) |
|
45 |
|
|
46 |
|
|
47 |
SITE_ID = 1 |
|
48 |
|
|
49 |
# If you set this to False, Django will make some optimizations so as not |
|
50 |
# to load the internationalization machinery. |
|
51 |
USE_I18N = True |
|
52 |
|
|
53 |
# Absolute path to the directory that holds media. |
|
54 |
# Example: "/home/media/media.lawrence.com/" |
|
55 |
#MEDIA_ROOT = '' |
|
56 |
|
|
57 |
# Root of static files used by each app, generated by code or uploaded by users |
|
58 |
#STATIC_URL = '/static/' |
|
59 |
|
|
60 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
61 |
# trailing slash if there is a path component (optional in other cases). |
|
62 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
63 |
#MEDIA_URL = '' |
|
64 |
|
|
65 |
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
66 |
# trailing slash. |
|
67 |
# Examples: "http://foo.com/media/", "/media/". |
|
68 |
|
|
69 |
|
|
70 |
# Make this unique, and don't share it with anybody. |
|
71 |
SECRET_KEY = 't^lii5_z@tho$%6t&b#dm#t9nz$$ylyclxvkdiyqbl+(dnt(ma' |
|
72 |
|
|
73 |
# List of callables that know how to import templates from various sources. |
|
74 |
TEMPLATE_LOADERS = ( |
|
75 |
'django.template.loaders.filesystem.Loader', |
|
76 |
'django.template.loaders.app_directories.Loader', |
|
77 |
# 'django.template.loaders.eggs.Loader', |
|
78 |
) |
|
79 |
|
|
80 |
MIDDLEWARE_CLASSES = ( |
|
81 |
'django.middleware.cache.UpdateCacheMiddleware', |
|
82 |
'corsheaders.middleware.CorsMiddleware', |
|
83 |
'django.middleware.common.CommonMiddleware', |
|
84 |
'django.middleware.cache.FetchFromCacheMiddleware', |
|
85 |
'django.middleware.gzip.GZipMiddleware', |
|
86 |
'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware', |
|
87 |
'django.contrib.sessions.middleware.SessionMiddleware', |
|
88 |
'django.middleware.csrf.CsrfViewMiddleware', |
|
89 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
90 |
#'django.middleware.locale.LocaleMiddleware', |
|
91 |
'django.contrib.messages.middleware.MessageMiddleware', |
|
92 |
#'django_openid_consumer.middleware.OpenIDMiddleware', |
|
93 |
'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware', |
|
94 |
'ldt.security.middleware.SecurityMiddleware', |
|
95 |
) |
|
96 |
|
|
97 |
TEMPLATE_CONTEXT_PROCESSORS = ( |
|
98 |
"django.core.context_processors.request", |
|
99 |
"django.contrib.auth.context_processors.auth", |
|
100 |
"django.core.context_processors.debug", |
|
101 |
"django.core.context_processors.i18n", |
|
102 |
"django.core.context_processors.media", |
|
103 |
"django.core.context_processors.static", |
|
104 |
"ldt.utils.context_processors.ldt_context", |
|
105 |
) |
|
106 |
|
|
107 |
|
|
108 |
ROOT_URLCONF = 'ldtplatform.urls' |
|
109 |
|
|
110 |
TEMPLATE_DIRS = ( |
|
111 |
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
112 |
# Always use forward slashes, even on Windows. |
|
113 |
# Don't forget to use absolute paths, not relative paths. |
|
114 |
os.path.join(os.path.basename(__file__), 'templates'), |
|
115 |
os.path.join(os.path.dirname(__file__), 'templates'), |
|
116 |
) |
|
117 |
|
|
118 |
FIXTURES_DIRS = ( |
|
119 |
os.path.join(os.path.basename(__file__), 'fixtures'), |
|
120 |
) |
|
121 |
|
|
122 |
INSTALLED_APPS = ( |
|
123 |
'django_extensions', |
|
124 |
'django.contrib.auth', |
|
125 |
'django.contrib.contenttypes', |
|
126 |
'django.contrib.sessions', |
|
127 |
'django.contrib.sites', |
|
128 |
'django.contrib.messages', |
|
129 |
'django.contrib.admin', |
|
130 |
'django.contrib.staticfiles', |
|
131 |
'haystack', |
|
132 |
'corsheaders', |
|
133 |
'tastypie', |
|
134 |
'guardian', |
|
135 |
'taggit', |
|
136 |
'taggit_templatetags', |
|
137 |
'registration', |
|
138 |
'oauth_provider', |
|
139 |
#'django_openid_consumer', |
|
140 |
'social.apps.django_app.default', |
|
141 |
'sorl.thumbnail', |
|
142 |
'ldt', |
|
143 |
'ldt.core', |
|
144 |
'ldt.security', |
|
145 |
'ldt.user', |
|
146 |
'ldt.ldt_utils', |
|
147 |
'ldt.text', |
|
148 |
'ldt.management', |
|
149 |
'ldt.indexation', |
|
150 |
'hashcut', |
|
151 |
'chunked_uploads', |
|
152 |
'ldtplatform', |
|
153 |
'metadatacomposer', |
|
154 |
) |
|
155 |
|
|
156 |
|
|
157 |
#AUTH_PROFILE_MODULE = 'user.UserProfile' |
|
158 |
AUTH_USER_MODEL = 'user.LdtUser' |
|
159 |
#INITIAL_CUSTOM_USER_MIGRATION = "0009_rename_auth_user_to_user_ldt_user" |
|
160 |
|
|
161 |
DECOUPAGE_BLACKLIST = ( |
|
162 |
"de_PPP", |
|
163 |
) |
|
164 |
|
|
165 |
ZIP_BLACKLIST = ( |
|
166 |
"__MACOSX", |
|
167 |
) |
|
168 |
|
|
169 |
AUTHENTICATION_BACKENDS = ( |
|
170 |
'guardian.backends.ObjectPermissionBackend', |
|
171 |
'django.contrib.auth.backends.ModelBackend', |
|
172 |
) |
|
173 |
#SOCIAL_AUTH_IMPORT_BACKENDS = ( |
|
174 |
# 'myproy.social_auth_extra_services', |
|
175 |
#) |
|
176 |
|
|
177 |
ACCOUNT_ACTIVATION_DAYS = 7 |
|
178 |
|
|
179 |
LDT_MAX_SEARCH_NUMBER = 50 |
|
180 |
LDT_JSON_DEFAULT_INDENT = 0 |
|
181 |
LDT_MAX_FRAGMENT_PER_SEARCH = 3 |
|
182 |
LDT_RESULTS_PER_PAGE = 10 |
|
183 |
LDT_MAX_CONTENTS_PER_PAGE = 10 |
|
184 |
LDT_MAX_PROJECTS_PER_PAGE = 10 |
|
185 |
LDT_FRONT_MEDIA_PER_PAGE = 9 |
|
186 |
LDT_FRONT_PROJECTS_PER_PAGE = 12 |
|
187 |
LDT_MEDIA_IN_RESULTS_PAGE = 6 |
|
188 |
|
|
189 |
OAUTH_PROVIDER_KEY_SIZE = 32 |
|
190 |
OAUTH_PROVIDER_SECRET_SIZE = 32 |
|
191 |
OAUTH_PROVIDER_VERIFIER_SIZE = 10 |
|
192 |
OAUTH_PROVIDER_CONSUMER_KEY_SIZE = 256 |
|
193 |
OAUTH_AUTHORIZE_VIEW = 'oauth_provider.views.fake_authorize_view' |
|
194 |
OAUTH_CALLBACK_VIEW = 'oauth_provider.views.fake_callback_view' |
|
195 |
TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888" |
|
196 |
|
|
197 |
|
|
198 |
SOCIAL_AUTH_COMPLETE_URL_NAME = 'complete' |
|
199 |
SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete' |
|
200 |
|
|
201 |
AUTO_INDEX_AFTER_SAVE = True |
|
202 |
|
|
203 |
ANONYMOUS_USER_ID = -1 |
|
204 |
|
|
205 |
WEB_VERSION = ldtplatform.get_version() |
|
206 |
|
|
207 |
DIVISIONS_FOR_STAT_ANNOTATION = 64 |
|
208 |
|
|
209 |
FRONT_TAG_LIST = [] |
|
210 |
|
|
211 |
DEFAULT_CONTENT_ICON = "thumbnails/contents/content_default_icon.png" |
|
212 |
DEFAULT_PROJECT_ICON = "thumbnails/projects/project_default_icon.png" |
|
213 |
DEFAULT_USER_ICON = "thumbnails/users/user_default_icon.png" |
|
214 |
DEFAULT_GROUP_ICON = "thumbnails/groups/group_default_icon.png" |
|
215 |
PROFILE_IMG_MAX_SIZE = 1000000 |
|
216 |
|
|
217 |
USE_GROUP_PERMISSIONS = ['Project', 'Content', 'Media'] |
|
218 |
FORBIDDEN_STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path=" |
|
219 |
PUBLIC_GROUP_NAME = 'everyone' |
|
220 |
MAX_USERS_SEARCH = 20 |
|
221 |
|
|
222 |
SYNTAX = { |
|
223 |
'++' : 'OK', |
|
224 |
'--' : 'KO', |
|
225 |
'==' : 'REF', |
|
226 |
'??' : 'Q' |
|
227 |
} |
|
228 |
|
|
229 |
EXTERNAL_STREAM_SRC = ['youtube.com', 'dailymotion.com', 'vimeo.com'] |
|
230 |
|
|
231 |
HAYSTACK_CONNECTIONS = { |
|
232 |
'default': { |
|
233 |
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
234 |
}, |
|
235 |
} |
|
236 |
HAYSTACK_SIGNAL_PROCESSOR = 'ldt.indexation.signals.LdtSignalProcessor' |
|
237 |
|
|
238 |
#Cors headers for API |
|
239 |
CORS_ORIGIN_ALLOW_ALL = True |
|
240 |
|
|
241 |
from config_docker import * |
|
242 |
|
|
243 |
if not "SRC_BASE_URL" in locals(): |
|
244 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
|
245 |
|
|
246 |
if not "LOGIN_URL" in locals(): |
|
247 |
LOGIN_URL = SRC_BASE_URL + 'accounts/login/' |
|
248 |
if not "LOGOUT_URL" in locals(): |
|
249 |
LOGOUT_URL = SRC_BASE_URL + 'accounts/disconnect/' |
|
250 |
if not "LOGIN_REDIRECT_URL" in locals(): |
|
251 |
LOGIN_REDIRECT_URL = SRC_BASE_URL + 'ldt/' |
|
252 |
if not "LOGOUT_REDIRECT_URL" in locals(): |
|
253 |
LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'accounts/login' |
|
254 |
if not "PROFILE_REDIRECT_URL" in locals(): |
|
255 |
PROFILE_REDIRECT_URL = SRC_BASE_URL + 'auth_accounts/create/profile' |
|
256 |
|
|
257 |
if not "LOGIN_ERROR_URL" in locals(): |
|
258 |
LOGIN_ERROR_URL = SRC_BASE_URL + 'accounts/login' |
|
259 |
|
|
260 |
# URL that handles the media served from MEDIA_ROOT. |
|
261 |
if not "MEDIA_URL" in locals(): |
|
262 |
MEDIA_URL = BASE_URL + 'static/media/' |
|
263 |
|
|
264 |
if not "CORS_URLS_REGEX" in locals(): |
|
265 |
CORS_URLS_REGEX = r"^" + BASE_URL + 'ldtplatform/api/.*$' |
|
266 |
|
|
267 |
#forced settings |
|
268 |
MAX_TAG_LENGTH = 255 |
|
269 |
FORCE_LOWERCASE_TAGS = True |
|
270 |
|
|
271 |
TAGGIT_TAGCLOUD_MIN = 1.0 |
|
272 |
TAGGIT_TAGCLOUD_MAX = 12.0 |