|
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 #ADMIN_MEDIA_PREFIX = '/media/' |
|
69 |
|
70 #LDT_MEDIA_PREFIX = '/ldt/' |
|
71 |
|
72 # Make this unique, and don't share it with anybody. |
|
73 SECRET_KEY = 't^lii5_z@tho$%6t&b#dm#t9nz$$ylyclxvkdiyqbl+(dnt(ma' |
|
74 |
|
75 # List of callables that know how to import templates from various sources. |
|
76 TEMPLATE_LOADERS = ( |
|
77 'django.template.loaders.filesystem.Loader', |
|
78 'django.template.loaders.app_directories.Loader', |
|
79 # 'django.template.loaders.eggs.Loader', |
|
80 ) |
|
81 |
|
82 MIDDLEWARE_CLASSES = ( |
|
83 'django.middleware.cache.UpdateCacheMiddleware', |
|
84 'django.middleware.common.CommonMiddleware', |
|
85 'django.middleware.cache.FetchFromCacheMiddleware', |
|
86 'django.middleware.gzip.GZipMiddleware', |
|
87 'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware', |
|
88 'django.contrib.sessions.middleware.SessionMiddleware', |
|
89 'django.middleware.csrf.CsrfViewMiddleware', |
|
90 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
91 #'django.middleware.locale.LocaleMiddleware', |
|
92 'django.contrib.messages.middleware.MessageMiddleware', |
|
93 'django_openid_consumer.middleware.OpenIDMiddleware', |
|
94 'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware', |
|
95 'ldt.security.middleware.SecurityMiddleware', |
|
96 ) |
|
97 |
|
98 TEMPLATE_CONTEXT_PROCESSORS = ( |
|
99 "django.core.context_processors.request", |
|
100 "django.contrib.auth.context_processors.auth", |
|
101 "django.core.context_processors.debug", |
|
102 "django.core.context_processors.i18n", |
|
103 "django.core.context_processors.media", |
|
104 "django.core.context_processors.static", |
|
105 "ldt.utils.context_processors.ldt_context", |
|
106 ) |
|
107 |
|
108 |
|
109 ROOT_URLCONF = 'ldtplatform.urls' |
|
110 |
|
111 TEMPLATE_DIRS = ( |
|
112 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
113 # Always use forward slashes, even on Windows. |
|
114 # Don't forget to use absolute paths, not relative paths. |
|
115 os.path.join(os.path.basename(__file__), 'templates'), |
|
116 os.path.join(os.path.dirname(__file__), 'templates'), |
|
117 ) |
|
118 |
|
119 FIXTURES_DIRS = ( |
|
120 os.path.join(os.path.basename(__file__), 'fixtures'), |
|
121 ) |
|
122 |
|
123 INSTALLED_APPS = ( |
|
124 'django_extensions', |
|
125 'django.contrib.auth', |
|
126 'django.contrib.contenttypes', |
|
127 'django.contrib.sessions', |
|
128 'django.contrib.sites', |
|
129 'django.contrib.messages', |
|
130 'django.contrib.admin', |
|
131 'django.contrib.staticfiles', |
|
132 'haystack', |
|
133 'ldtplatform', |
|
134 'registration', |
|
135 'tagging', |
|
136 'ldt', |
|
137 'ldt.core', |
|
138 'ldt.ldt_utils', |
|
139 'ldt.text', |
|
140 'ldt.user', |
|
141 'ldt.management', |
|
142 'ldt.indexation', |
|
143 'oauth_provider', |
|
144 'django_openid_consumer', |
|
145 'social_auth', |
|
146 'south', |
|
147 'guardian', |
|
148 'sorl.thumbnail', |
|
149 'tastypie', |
|
150 ) |
|
151 |
|
152 AUTH_PROFILE_MODULE = 'user.UserProfile' |
|
153 |
|
154 DECOUPAGE_BLACKLIST = ( |
|
155 "de_PPP", |
|
156 ) |
|
157 |
|
158 ZIP_BLACKLIST = ( |
|
159 "__MACOSX", |
|
160 ) |
|
161 |
|
162 AUTHENTICATION_BACKENDS = ( |
|
163 'social_auth.backends.twitter.TwitterBackend', |
|
164 'social_auth.backends.facebook.FacebookBackend', |
|
165 # 'social_auth.backends.google.GoogleOAuthBackend', |
|
166 # 'social_auth.backends.google.GoogleOAuth2Backend', |
|
167 'social_auth.backends.google.GoogleBackend', |
|
168 'social_auth.backends.yahoo.YahooBackend', |
|
169 # 'social_auth.backends.contrib.linkedin.LinkedinBackend', |
|
170 # 'social_auth.backends.contrib.LiveJournalBackend', |
|
171 # 'social_auth.backends.contrib.orkut.OrkutBackend', |
|
172 'social_auth.backends.OpenIDBackend', |
|
173 'django.contrib.auth.backends.ModelBackend', |
|
174 'guardian.backends.ObjectPermissionBackend', |
|
175 ) |
|
176 SOCIAL_AUTH_IMPORT_BACKENDS = ( |
|
177 'myproy.social_auth_extra_services', |
|
178 ) |
|
179 |
|
180 ACCOUNT_ACTIVATION_DAYS = 7 |
|
181 |
|
182 LDT_MAX_SEARCH_NUMBER = 50 |
|
183 LDT_JSON_DEFAULT_INDENT = 0 |
|
184 LDT_MAX_FRAGMENT_PER_SEARCH = 3 |
|
185 LDT_RESULTS_PER_PAGE = 10 |
|
186 LDT_MAX_CONTENTS_PER_PAGE = 10 |
|
187 LDT_MAX_PROJECTS_PER_PAGE = 10 |
|
188 LDT_FRONT_MEDIA_PER_PAGE = 9 |
|
189 |
|
190 OAUTH_PROVIDER_KEY_SIZE = 32 |
|
191 OAUTH_PROVIDER_SECRET_SIZE = 32 |
|
192 OAUTH_PROVIDER_VERIFIER_SIZE = 10 |
|
193 OAUTH_PROVIDER_CONSUMER_KEY_SIZE = 256 |
|
194 OAUTH_AUTHORIZE_VIEW = 'oauth_provider.views.fake_authorize_view' |
|
195 OAUTH_CALLBACK_VIEW = 'oauth_provider.views.fake_callback_view' |
|
196 TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888" |
|
197 |
|
198 TWITTER_CONSUMER_KEY = 'UxAdbOLSo4Mx3CXIwDG9Eg' |
|
199 TWITTER_CONSUMER_SECRET = '2PcWgdjnJL6Vp8srB40jeAo0fjMEtDnUwmAia6EUww' |
|
200 FACEBOOK_APP_ID = '163134140411313' |
|
201 FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012' |
|
202 |
|
203 SOCIAL_AUTH_COMPLETE_URL_NAME = 'complete' |
|
204 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete' |
|
205 |
|
206 |
|
207 AUTO_INDEX_AFTER_SAVE = True |
|
208 |
|
209 ANONYMOUS_USER_ID = -1 |
|
210 |
|
211 WEB_VERSION = ldtplatform.get_version() |
|
212 |
|
213 DIVISIONS_FOR_STAT_ANNOTATION = 64 |
|
214 |
|
215 FRONT_TAG_LIST = [] |
|
216 |
|
217 DEFAULT_CONTENT_ICON = "thumbnails/contents/content_default_icon.png" |
|
218 DEFAULT_PROJECT_ICON = "thumbnails/projects/project_default_icon.png" |
|
219 DEFAULT_USER_ICON = "thumbnails/users/user_default_icon.png" |
|
220 DEFAULT_GROUP_ICON = "thumbnails/groups/group_default_icon.png" |
|
221 PROFILE_IMG_MAX_SIZE = 1000000 |
|
222 |
|
223 USE_GROUP_PERMISSIONS = ['Project', 'Content', 'Media'] |
|
224 FORBIDDEN_STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path=" |
|
225 PUBLIC_GROUP_NAME = 'everyone' |
|
226 MAX_USERS_SEARCH = 20 |
|
227 |
|
228 SYNTAX = { |
|
229 '++' : 'OK', |
|
230 '--' : 'KO', |
|
231 '==' : 'REF', |
|
232 '??' : 'Q' |
|
233 } |
|
234 |
|
235 EXTERNAL_STREAM_SRC = ['youtube.com', 'dailymotion.com', 'vimeo.com'] |
|
236 |
|
237 HAYSTACK_CONNECTIONS = { |
|
238 'default': { |
|
239 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
240 }, |
|
241 } |
|
242 |
|
243 from config import * |
|
244 |
|
245 if not "LOGIN_URL" in locals(): |
|
246 LOGIN_URL = BASE_URL + 'ldtplatform/accounts/login/' |
|
247 if not "LOGOUT_URL" in locals(): |
|
248 LOGOUT_URL = BASE_URL + 'ldtplatform/accounts/disconnect/' |
|
249 if not "LOGIN_REDIRECT_URL" in locals(): |
|
250 LOGIN_REDIRECT_URL = BASE_URL + 'ldtplatform/ldt/' |
|
251 if not "LOGOUT_REDIRECT_URL" in locals(): |
|
252 LOGOUT_REDIRECT_URL = BASE_URL + 'ldtplatform/accounts/login' |
|
253 if not "PROFILE_REDIRECT_URL" in locals(): |
|
254 PROFILE_REDIRECT_URL = BASE_URL + 'ldtplatform/auth_accounts/create/profile' |
|
255 |
|
256 if not "LOGIN_ERROR_URL" in locals(): |
|
257 LOGIN_ERROR_URL = BASE_URL + 'ldtplatform/accounts/login' |
|
258 |
|
259 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
260 # trailing slash. |
|
261 # Examples: "http://foo.com/media/", "/media/". |
|
262 if not "ADMIN_MEDIA_PREFIX" in locals(): |
|
263 ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' |
|
264 # Used in a lot of templates |
|
265 if not "LDT_MEDIA_PREFIX" in locals(): |
|
266 LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' |
|
267 # URL that handles the media served from MEDIA_ROOT. |
|
268 if not "MEDIA_URL" in locals(): |
|
269 MEDIA_URL = BASE_URL + 'static/media/' |
|
270 |
|
271 #forced settings |
|
272 MAX_TAG_LENGTH = 255 |
|
273 FORCE_LOWERCASE_TAGS = True |
|
274 |
|
275 |