|
1 """ |
|
2 Django settings for remieplt project. |
|
3 |
|
4 Generated by 'django-admin startproject' using Django 1.8.2. |
|
5 |
|
6 For more information on this file, see |
|
7 https://docs.djangoproject.com/en/dev/topics/settings/ |
|
8 |
|
9 For the full list of settings and their values, see |
|
10 https://docs.djangoproject.com/en/dev/ref/settings/ |
|
11 """ |
|
12 |
|
13 # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
|
14 import os, remieplt |
|
15 |
|
16 BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
|
17 |
|
18 |
|
19 # Quick-start development settings - unsuitable for production |
|
20 # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ |
|
21 |
|
22 # SECURITY WARNING: keep the secret key used in production secret! |
|
23 SECRET_KEY = None |
|
24 |
|
25 # SECURITY WARNING: don't run with debug turned on in production! |
|
26 DEBUG = False |
|
27 |
|
28 ALLOWED_HOSTS = [] |
|
29 |
|
30 |
|
31 # Application definition |
|
32 |
|
33 INSTALLED_APPS = ( |
|
34 'django_extensions', |
|
35 'django.contrib.admin', |
|
36 'django.contrib.auth', |
|
37 'django.contrib.contenttypes', |
|
38 'django.contrib.sessions', |
|
39 'django.contrib.messages', |
|
40 'django.contrib.staticfiles', |
|
41 'django.contrib.sites', |
|
42 'haystack', |
|
43 'corsheaders', |
|
44 'tastypie', |
|
45 'guardian', |
|
46 'taggit', |
|
47 'taggit_templatetags', |
|
48 'registration', |
|
49 'oauth_provider', |
|
50 'social.apps.django_app.default', |
|
51 'sorl.thumbnail', |
|
52 'ldt', |
|
53 'ldt.core', |
|
54 'ldt.security', |
|
55 'ldt.user', |
|
56 'ldt.ldt_utils', |
|
57 'ldt.text', |
|
58 'ldt.management', |
|
59 'ldt.indexation', |
|
60 'chunked_uploads', |
|
61 'remie' |
|
62 ) |
|
63 |
|
64 MIDDLEWARE_CLASSES = ( |
|
65 'django.middleware.cache.UpdateCacheMiddleware', |
|
66 'django.middleware.cache.FetchFromCacheMiddleware', |
|
67 'corsheaders.middleware.CorsMiddleware', |
|
68 'django.contrib.sessions.middleware.SessionMiddleware', |
|
69 'django.middleware.common.CommonMiddleware', |
|
70 'django.middleware.gzip.GZipMiddleware', |
|
71 'django.middleware.csrf.CsrfViewMiddleware', |
|
72 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
73 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
|
74 'django.contrib.messages.middleware.MessageMiddleware', |
|
75 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
|
76 'django.middleware.security.SecurityMiddleware', |
|
77 'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware', |
|
78 'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware', |
|
79 'ldt.security.middleware.SecurityMiddleware', |
|
80 ) |
|
81 |
|
82 ROOT_URLCONF = 'remieplt.urls' |
|
83 |
|
84 TEMPLATES = [ |
|
85 { |
|
86 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
|
87 'DIRS': [os.path.join(os.path.dirname(os.path.dirname(__file__)), 'templates')], |
|
88 'APP_DIRS': True, |
|
89 'OPTIONS': { |
|
90 'context_processors': [ |
|
91 'django.template.context_processors.debug', |
|
92 'django.template.context_processors.request', |
|
93 'django.contrib.auth.context_processors.auth', |
|
94 'django.template.context_processors.i18n', |
|
95 'django.template.context_processors.media', |
|
96 'django.template.context_processors.static', |
|
97 'django.template.context_processors.tz', |
|
98 'django.contrib.messages.context_processors.messages', |
|
99 'ldt.utils.context_processors.ldt_context', |
|
100 ], |
|
101 }, |
|
102 }, |
|
103 ] |
|
104 |
|
105 WSGI_APPLICATION = 'remieplt.wsgi.application' |
|
106 |
|
107 |
|
108 # Database |
|
109 # https://docs.djangoproject.com/en/dev/ref/settings/#databases |
|
110 |
|
111 DATABASES = { |
|
112 'default': { |
|
113 'ENGINE': 'django.db.backends.sqlite3', |
|
114 'NAME': os.path.abspath(os.path.join(BASE_DIR, '..', '..', 'run', 'db.sqlite3')), |
|
115 } |
|
116 } |
|
117 |
|
118 |
|
119 # Internationalization |
|
120 # https://docs.djangoproject.com/en/dev/topics/i18n/ |
|
121 |
|
122 LANGUAGE_CODE = 'en-us' |
|
123 |
|
124 TIME_ZONE = 'UTC' |
|
125 |
|
126 USE_I18N = True |
|
127 |
|
128 USE_L10N = True |
|
129 |
|
130 USE_TZ = True |
|
131 |
|
132 ugettext = lambda s: s |
|
133 |
|
134 LANGUAGES = ( |
|
135 ('fr', ugettext('French')), |
|
136 ('en', ugettext('English')), |
|
137 ('ja', ugettext('Japanese')), |
|
138 ) |
|
139 |
|
140 SITE_ID = 1 |
|
141 |
|
142 # Static files (CSS, JavaScript, Images) |
|
143 # https://docs.djangoproject.com/en/dev/howto/static-files/ |
|
144 |
|
145 STATIC_URL = '/static/' |
|
146 |
|
147 |
|
148 AUTH_USER_MODEL = 'user.LdtUser' |
|
149 |
|
150 AUTHENTICATION_BACKENDS = ( |
|
151 # 'social.backends.open_id.OpenIdAuth', |
|
152 # 'social.backends.google.GoogleOpenId', |
|
153 # 'social.backends.twitter.TwitterOAuth', |
|
154 # 'social.backends.facebook.FacebookOAuth2', |
|
155 'guardian.backends.ObjectPermissionBackend', |
|
156 'django.contrib.auth.backends.ModelBackend', |
|
157 ) |
|
158 |
|
159 |
|
160 ADMINS = ( |
|
161 #('Your Name', 'your_email@domain.com'), |
|
162 ) |
|
163 |
|
164 MANAGERS = ADMINS |
|
165 |
|
166 |
|
167 |
|
168 # Registration settings |
|
169 ACCOUNT_ACTIVATION_DAYS = 7 |
|
170 REGISTRATION_OPEN = False |
|
171 |
|
172 |
|
173 # ldt settings |
|
174 DECOUPAGE_BLACKLIST = ( |
|
175 "de_PPP", |
|
176 ) |
|
177 |
|
178 ZIP_BLACKLIST = ( |
|
179 "__MACOSX", |
|
180 ) |
|
181 |
|
182 LDT_MAX_SEARCH_NUMBER = 50 |
|
183 LDT_JSON_DEFAULT_INDENT = 2 |
|
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 LDT_FRONT_PROJECTS_PER_PAGE = 12 |
|
190 LDT_MEDIA_IN_RESULTS_PAGE = 6 |
|
191 |
|
192 TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888" |
|
193 |
|
194 EMPTY_MEDIA_EXTERNALID = None |
|
195 |
|
196 |
|
197 SOCIAL_AUTH_COMPLETE_URL_NAME = 'complete' |
|
198 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete' |
|
199 |
|
200 AUTO_INDEX_AFTER_SAVE = True |
|
201 |
|
202 ANONYMOUS_USER_ID = -1 |
|
203 |
|
204 WEB_VERSION = remieplt.get_version() |
|
205 |
|
206 DIVISIONS_FOR_STAT_ANNOTATION = 64 |
|
207 |
|
208 FRONT_TAG_LIST = [] |
|
209 |
|
210 DEFAULT_CONTENT_ICON = "thumbnails/contents/content_default_icon.png" |
|
211 DEFAULT_PROJECT_ICON = "thumbnails/projects/project_default_icon.png" |
|
212 DEFAULT_USER_ICON = "thumbnails/users/user_default_icon.png" |
|
213 DEFAULT_GROUP_ICON = "thumbnails/groups/group_default_icon.png" |
|
214 PROFILE_IMG_MAX_SIZE = 1000000 |
|
215 |
|
216 USE_GROUP_PERMISSIONS = ['Project', 'Content', 'Media'] |
|
217 FORBIDDEN_STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path=" |
|
218 PUBLIC_GROUP_NAME = 'everyone' |
|
219 MAX_USERS_SEARCH = 20 |
|
220 |
|
221 SYNTAX = { |
|
222 '++' : 'OK', |
|
223 '--' : 'KO', |
|
224 '==' : 'REF', |
|
225 '??' : 'Q' |
|
226 } |
|
227 |
|
228 EXTERNAL_STREAM_SRC = ['youtube.com', 'dailymotion.com', 'vimeo.com'] |
|
229 |
|
230 HAYSTACK_CONNECTIONS = { |
|
231 'default': { |
|
232 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
233 }, |
|
234 } |
|
235 HAYSTACK_SIGNAL_PROCESSOR = 'ldt.indexation.signals.LdtSignalProcessor' |
|
236 LDT_INDEXATION_INSERT_BATCH_SIZE = 5000 |
|
237 |
|
238 |
|
239 #Cors headers for API |
|
240 CORS_ORIGIN_ALLOW_ALL = True |
|
241 |
|
242 |
|
243 MAX_TAG_LENGTH = 255 |
|
244 FORCE_LOWERCASE_TAGS = True |
|
245 |
|
246 TAGGIT_TAGCLOUD_MIN = 1.0 |
|
247 TAGGIT_TAGCLOUD_MAX = 12.0 |
|
248 |
|
249 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' |