3
|
1 |
# -*- coding: utf-8 -*- |
|
2 |
from remieplt.settings import * |
|
3 |
import os, logging |
|
4 |
|
|
5 |
#TODO override |
|
6 |
DEBUG = True |
|
7 |
TEMPLATE_DEBUG = DEBUG |
|
8 |
|
|
9 |
|
|
10 |
BASE_URL = '%(base_url)s' |
|
11 |
WEB_URL = '%(web_url)s' |
|
12 |
|
|
13 |
PLATFORM_BASE_URL = WEB_URL + BASE_URL + 'remieplt/' |
|
14 |
|
|
15 |
STREAM_SRC_PREFIX = "" |
|
16 |
|
|
17 |
BASE_STATIC_URL = WEB_URL + BASE_URL + 'static/' |
|
18 |
BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../../web/static/").rstrip("/")+"/" |
|
19 |
|
|
20 |
STREAM_URL = BASE_STATIC_URL + "/content/" |
|
21 |
|
|
22 |
|
|
23 |
# Absolute path to the directory that holds media. |
|
24 |
# Example: "/home/media/media.lawrence.com/" |
|
25 |
MEDIA_ROOT = BASE_STATIC_ROOT + "media/" |
|
26 |
|
|
27 |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
28 |
# trailing slash if there is a path component (optional in other cases). |
|
29 |
# Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
30 |
MEDIA_URL = BASE_STATIC_URL + 'media/' |
|
31 |
|
|
32 |
|
|
33 |
STATIC_URL = BASE_STATIC_URL + 'site/' |
|
34 |
|
|
35 |
# Absolute path to the directory that static files (js, css, swf...) |
|
36 |
# DO NOT forget to do command line ./manage.py collectstatic to gather static media into the web/static folder |
|
37 |
STATIC_ROOT = BASE_STATIC_ROOT + "site/" |
|
38 |
|
|
39 |
CONTENT_ROOT = MEDIA_ROOT + "/content/" |
|
40 |
|
|
41 |
STREAM_PATH = CONTENT_ROOT |
|
42 |
|
|
43 |
|
|
44 |
SRC_BASE_URL = BASE_URL + __name__.split('.')[0] + '/' |
|
45 |
|
|
46 |
LOGIN_URL = SRC_BASE_URL + 'accounts/login/' |
|
47 |
LOGOUT_URL = SRC_BASE_URL + 'accounts/disconnect/' |
|
48 |
LOGIN_REDIRECT_URL = SRC_BASE_URL + 'ldt/' |
|
49 |
LOGOUT_REDIRECT_URL = SRC_BASE_URL + 'accounts/login' |
|
50 |
PROFILE_REDIRECT_URL = SRC_BASE_URL + 'auth_accounts/create/profile' |
|
51 |
LOGIN_ERROR_URL = SRC_BASE_URL + 'accounts/login' |
|
52 |
|
|
53 |
|
16
|
54 |
CORS_URLS_REGEX = r"^" + BASE_URL + 'remie/api/.*$' |
3
|
55 |
|
|
56 |
|
|
57 |
# Make this unique, and don't share it with anybody. |
|
58 |
SECRET_KEY = '%(secret_key)s' |
|
59 |
|
|
60 |
# PATH to the ffmpeg executable, used to know automatically the media file duration |
|
61 |
FFMPEG_PATH = "" |
|
62 |
|
|
63 |
|
|
64 |
DATABASES = { |
|
65 |
'default': { |
|
66 |
'ENGINE': 'django.db.backends.%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
67 |
'NAME': '%(db_name)s', # Or path to database file if using sqlite3. |
|
68 |
'USER': '%(db_user)s', # Not used with sqlite3. |
|
69 |
'PASSWORD': '%(db_password)s', # Not used with sqlite3. |
|
70 |
'HOST': '%(db_host)s', # Set to empty string for localhost. Not used with sqlite3. |
|
71 |
'PORT': '%(db_port)d', # Set to empty string for default. Not used with sqlite3. |
|
72 |
}, |
|
73 |
} |
|
74 |
|
|
75 |
LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../run/log/log.txt")) |
|
76 |
LOG_LEVEL = logging.DEBUG |
|
77 |
|
|
78 |
LOGGING = { |
|
79 |
'version': 1, |
|
80 |
'disable_existing_loggers': False, |
|
81 |
'filters': { |
|
82 |
'require_debug_false': { |
|
83 |
'()': 'django.utils.log.RequireDebugFalse' |
|
84 |
} |
|
85 |
}, |
|
86 |
'formatters' : { |
|
87 |
'simple' : { |
|
88 |
'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
89 |
}, |
|
90 |
'semi-verbose': { |
|
91 |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
92 |
}, |
|
93 |
}, |
|
94 |
'handlers': { |
|
95 |
'mail_admins': { |
|
96 |
'level': 'ERROR', |
|
97 |
'filters': ['require_debug_false'], |
|
98 |
'class': 'django.utils.log.AdminEmailHandler' |
|
99 |
}, |
|
100 |
'stream_to_console': { |
|
101 |
'level': LOG_LEVEL, |
|
102 |
'class': 'logging.StreamHandler' |
|
103 |
}, |
|
104 |
'file': { |
|
105 |
'level': LOG_LEVEL, |
|
106 |
'class': 'logging.FileHandler', |
|
107 |
'filename': LOG_FILE, |
|
108 |
'formatter': 'semi-verbose', |
|
109 |
}, |
|
110 |
}, |
|
111 |
'loggers': { |
|
112 |
# 'django.db.backends':{ |
|
113 |
# 'handlers': ['file'], |
|
114 |
# 'level': LOG_LEVEL, |
|
115 |
# 'propagate': True, |
|
116 |
# }, |
|
117 |
'django.request': { |
|
118 |
'handlers': ['file'], |
|
119 |
'level': LOG_LEVEL, |
|
120 |
'propagate': True, |
|
121 |
}, |
|
122 |
'ldt': { |
|
123 |
'handlers': ['file'], |
|
124 |
'level': LOG_LEVEL, |
|
125 |
'propagate': True, |
|
126 |
}, |
|
127 |
# 'pyelasticsearch': { |
|
128 |
# 'handlers': ['file'], |
|
129 |
# 'level': LOG_LEVEL, |
|
130 |
# 'propagate': True, |
|
131 |
# }, |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
135 |
|
|
136 |
ADMINS = ( |
|
137 |
#('Your Name', 'your_email@domain.com'), |
|
138 |
) |
|
139 |
|
|
140 |
MANAGERS = ADMINS |
|
141 |
|
|
142 |
GOOGLE_ANALYTICS_CODE = None |
|
143 |
|
|
144 |
|
|
145 |
ACCOUNT_ACTIVATION_DAYS = 7 |
|
146 |
REGISTRATION_OPEN = False |
|
147 |
|
|
148 |
LDT_MAX_SEARCH_NUMBER = 50 |
|
149 |
LDT_JSON_DEFAULT_INDENT = 2 |
|
150 |
|
|
151 |
EMPTY_MEDIA_EXTERNALID = None |
|
152 |
|
|
153 |
FRONT_TAG_LIST = [u"Enmi 2011", u"film", u"conférence"] |
|
154 |
|
|
155 |
HAYSTACK_CONNECTIONS = { |
|
156 |
'default': { |
|
157 |
'ENGINE': 'ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine', |
|
158 |
'URL': 'http://127.0.0.1:9200/', |
|
159 |
'INDEX_NAME': 'ldt', |
|
160 |
}, |
|
161 |
} |