|
0
|
1 |
# -*- coding: utf-8 -*- |
|
|
2 |
import os, logging |
|
|
3 |
|
|
|
4 |
from environs import Env |
|
|
5 |
|
|
|
6 |
env = Env() |
|
|
7 |
# Read .env into os.environ |
|
|
8 |
env.read_env() |
|
|
9 |
|
|
|
10 |
SITE_ID = 1 |
|
|
11 |
|
|
|
12 |
BASE_DIR = "/iridata/www/ldt/src/ldtplatform/" |
|
|
13 |
BASE_URL = "/" |
|
|
14 |
PLATFORM_BASE_URL = BASE_URL + "ldtplatform/" |
|
|
15 |
WEB_URL = "https://ldt.iri.centrepompidou.fr/" |
|
|
16 |
WEB_AUTH = [] |
|
|
17 |
STATIC_URL = BASE_URL + "static/site/" |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/" |
|
|
21 |
|
|
|
22 |
STREAM_SRC_PREFIX = "" |
|
|
23 |
|
|
|
24 |
BASE_STATIC_ROOT = "/static/" |
|
|
25 |
BASE_STATIC_URL = BASE_URL + "static/" |
|
|
26 |
|
|
|
27 |
# Absolute path to the directory that holds media. |
|
|
28 |
# Example: "/home/media/media.lawrence.com/" |
|
|
29 |
MEDIA_ROOT = "/iridata/www/ldt/web/static/media/" |
|
|
30 |
|
|
|
31 |
|
|
|
32 |
# Absolute path to the directory that static files (js, css, swf...) |
|
|
33 |
# DO NOT forget to do command line ./manage.py collectstatic to gather static media into the web/static folder |
|
|
34 |
STATIC_ROOT = BASE_STATIC_ROOT + "site/" |
|
|
35 |
|
|
|
36 |
# Make this unique, and don't share it with anybody. |
|
|
37 |
SECRET_KEY = env.str("LDT_SECRET") |
|
|
38 |
|
|
|
39 |
# PATH to the ffmpeg executable, used to know automatically the media file duration |
|
|
40 |
FFMPEG_PATH = "/usr/bin/ffmpeg" |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
CONTENT_ROOT = BASE_STATIC_ROOT + "content/" |
|
|
44 |
|
|
|
45 |
# PATH where uploaded media are put. |
|
|
46 |
STREAM_PATH = CONTENT_ROOT |
|
|
47 |
|
|
|
48 |
ADMIN_MEDIA_PREFIX = STATIC_URL + "admin/" |
|
|
49 |
LDT_MEDIA_PREFIX = STATIC_URL + "ldt/" |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
DATABASES = { |
|
|
53 |
"default": env.dj_db_url("DATABASE_URL") |
|
|
54 |
} |
|
|
55 |
|
|
|
56 |
CACHES = { |
|
|
57 |
"default": { |
|
|
58 |
"BACKEND": "django.core.cache.backends.memcached.MemcachedCache", |
|
|
59 |
"LOCATION": "cache:11211", |
|
|
60 |
"KEY_PREFIX": "ldt", |
|
|
61 |
} |
|
|
62 |
} |
|
|
63 |
|
|
|
64 |
DEBUG = env.bool("DEBUG", default=False) |
|
|
65 |
TEMPLATE_DEBUG = DEBUG |
|
|
66 |
|
|
|
67 |
LOG_LEVEL = logging.INFO |
|
|
68 |
|
|
|
69 |
LOGGING = { |
|
|
70 |
"version": 1, |
|
|
71 |
"disable_existing_loggers": False, |
|
|
72 |
"formatters": { |
|
|
73 |
"simple": { |
|
|
74 |
"format": "%(asctime)s - %(levelname)s : %(message)s", |
|
|
75 |
}, |
|
|
76 |
"semi-verbose": {"format": "%(levelname)s %(asctime)s %(module)s %(message)s"}, |
|
|
77 |
}, |
|
|
78 |
"filters": {"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"}}, |
|
|
79 |
"handlers": { |
|
|
80 |
"stream_to_console": {"level": LOG_LEVEL, "class": "logging.StreamHandler"}, |
|
|
81 |
}, |
|
|
82 |
"loggers": { |
|
|
83 |
# 'django.db.backends':{ |
|
|
84 |
# 'handlers': ['file'], |
|
|
85 |
# 'level': LOG_LEVEL, |
|
|
86 |
# 'propagate': True, |
|
|
87 |
# }, |
|
|
88 |
# 'django.request': { |
|
|
89 |
# 'handlers': ['file'], |
|
|
90 |
# 'level': LOG_LEVEL, |
|
|
91 |
# 'propagate': True, |
|
|
92 |
# }, |
|
|
93 |
"ldt": { |
|
|
94 |
"handlers": ["stream_to_console"], |
|
|
95 |
"level": LOG_LEVEL, |
|
|
96 |
"propagate": True, |
|
|
97 |
}, |
|
|
98 |
"ldt_utils": { |
|
|
99 |
"handlers": ["stream_to_console"], |
|
|
100 |
"level": LOG_LEVEL, |
|
|
101 |
"propagate": True, |
|
|
102 |
}, |
|
|
103 |
"api": { |
|
|
104 |
"handlers": ["stream_to_console"], |
|
|
105 |
"level": LOG_LEVEL, |
|
|
106 |
"propagate": True, |
|
|
107 |
}, |
|
|
108 |
"tastypie": { |
|
|
109 |
"handlers": ["stream_to_console"], |
|
|
110 |
"level": LOG_LEVEL, |
|
|
111 |
"propagate": True, |
|
|
112 |
}, |
|
|
113 |
}, |
|
|
114 |
} |
|
|
115 |
|
|
|
116 |
|
|
|
117 |
ADMINS = ( |
|
|
118 |
# ('Your Name', 'your_email@domain.com'), |
|
|
119 |
) |
|
|
120 |
|
|
|
121 |
MANAGERS = ADMINS |
|
|
122 |
|
|
|
123 |
GOOGLE_ANALYTICS_CODE = None |
|
|
124 |
|
|
|
125 |
# EMAIL_USE_TLS = True |
|
|
126 |
# EMAIL_HOST = 'smtp.gmail.com' |
|
|
127 |
# EMAIL_HOST_USER = 'iri.ddc@gmail.com' |
|
|
128 |
# EMAIL_HOST_PASSWORD = 'ddciripompidou' |
|
|
129 |
# EMAIL_PORT = 587 |
|
|
130 |
DEFAULT_FROM_EMAIL = "root@iri.centrepompidou.fr" |
|
|
131 |
|
|
|
132 |
ACCOUNT_ACTIVATION_DAYS = 7 |
|
|
133 |
REGISTRATION_OPEN = False |
|
|
134 |
|
|
|
135 |
LDT_MAX_SEARCH_NUMBER = 50 |
|
|
136 |
LDT_MAX_FRAGMENT_PER_SEARCH = 3 |
|
|
137 |
LDT_RESULTS_PER_PAGE = 50 |
|
|
138 |
LDT_JSON_DEFAULT_INDENT = 0 |
|
|
139 |
|
|
|
140 |
EMPTY_MEDIA_EXTERNALID = None |
|
|
141 |
|
|
|
142 |
AUTO_INDEX_AFTER_SAVE = True |
|
|
143 |
|
|
|
144 |
FORBIDDEN_STREAM_URL = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/forbidden_stream.mp4?old_path=" |
|
|
145 |
AUDIO_RECORD_URL = "rtmp://media.iri.centrepompidou.fr/ddc_micro_record" |
|
|
146 |
|
|
|
147 |
FRONT_TAG_LIST = ["enmi23", "film", "conférence"] |
|
|
148 |
|
|
|
149 |
AUTHENTICATION_BACKENDS = ( |
|
|
150 |
# 'social_auth.backends.twitter.TwitterBackend', |
|
|
151 |
# 'social_auth.backends.facebook.FacebookBackend', |
|
|
152 |
# 'social_auth.backends.google.GoogleOAuthBackend', |
|
|
153 |
# 'social_auth.backends.google.GoogleOAuth2Backend', |
|
|
154 |
# 'social_auth.backends.google.GoogleBackend', |
|
|
155 |
# 'social_auth.backends.yahoo.YahooBackend', |
|
|
156 |
# 'social_auth.backends.contrib.linkedin.LinkedinBackend', |
|
|
157 |
# 'social_auth.backends.contrib.LiveJournalBackend', |
|
|
158 |
# 'social_auth.backends.contrib.orkut.OrkutBackend', |
|
|
159 |
# 'social_auth.backends.OpenIDBackend', |
|
|
160 |
"django.contrib.auth.backends.ModelBackend", |
|
|
161 |
"guardian.backends.ObjectPermissionBackend", |
|
|
162 |
) |
|
|
163 |
|
|
|
164 |
HAYSTACK_CONNECTIONS = { |
|
|
165 |
"default": { |
|
|
166 |
# for elasticsearch use ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine |
|
|
167 |
#'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
|
168 |
"ENGINE": "ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine", |
|
|
169 |
"URL": env.str("ES_HOST", default="es")+":9200", |
|
|
170 |
"INDEX_NAME": "ldt", |
|
|
171 |
}, |
|
|
172 |
} |
|
|
173 |
|
|
|
174 |
POLEMIC_PROTOCOL_DEFINITION = { |
|
|
175 |
"1": [ |
|
|
176 |
{"name": "OK", "keywords": ["++"], "color": "#1D973D"}, |
|
|
177 |
{"name": "KO", "keywords": ["--"], "color": "#CE0A15"}, |
|
|
178 |
{"name": "REF", "keywords": ["==", "http://"], "color": "#C5A62D"}, |
|
|
179 |
{"name": "Q", "keywords": ["?"], "color": "#036AAE"}, |
|
|
180 |
], |
|
|
181 |
"2": [ |
|
|
182 |
{"name": "OK", "keywords": ["++"], "color": "#1D973D"}, |
|
|
183 |
{"name": "KO", "keywords": ["!!"], "color": "#CE0A15"}, |
|
|
184 |
{"name": "REF", "keywords": ["==", "http://"], "color": "#C5A62D"}, |
|
|
185 |
{"name": "Q", "keywords": ["?"], "color": "#036AAE"}, |
|
|
186 |
], |
|
|
187 |
"3": [ |
|
|
188 |
{"name": "OK", "keywords": ["++"], "color": "#196be6"}, |
|
|
189 |
{"name": "KO", "keywords": ["??"], "color": "#e6b919"}, |
|
|
190 |
{"name": "REF", "keywords": ["**", "http://", "https://"], "color": "#e619e6"}, |
|
|
191 |
{"name": "Q", "keywords": ["=="], "color": "#42e619"}, |
|
|
192 |
], |
|
|
193 |
} |
|
|
194 |
|
|
|
195 |
USE_X_FORWARDED_HOST = True |
|
|
196 |
SECURE_PROXY_SSL_HEADER = ("x-forwarded-proto", "https") |
|
|
197 |
ALLOWED_HOSTS=["ldt.iri.centrepompidou.fr","127.0.0.1","localhost"] |
|
|
198 |
|
|
|
199 |
HTTPLIB2_DISABLE_SSL_CERTIFICATE_VALIDATION = True |