|
1 # -*- coding: utf-8 -*- |
|
2 import os, logging |
|
3 |
|
4 SITE_ID = 1 |
|
5 |
|
6 #configuration for runserver |
|
7 #BASE_URL = '/' |
|
8 #PLATFORM_BASE_URL = '/' |
|
9 #WEB_URL = '' |
|
10 #WEB_AUTH = [] |
|
11 |
|
12 |
|
13 |
|
14 #BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" |
|
15 BASE_DIR = '%(base_dir)s' |
|
16 BASE_URL = '%(base_url)s' |
|
17 PLATFORM_BASE_URL = BASE_URL + 'ldtplatform/' |
|
18 WEB_URL = '%(web_url)s' |
|
19 WEB_AUTH = [] # example [{'REGEX': 'localhost/~ymh/platform', 'NAME': 'ymh', 'PASSWORD': 'ymh'}] |
|
20 STATIC_URL = BASE_URL + 'static/site/' |
|
21 |
|
22 |
|
23 STREAM_URL = "%(stream_url)s" |
|
24 |
|
25 STREAM_SRC_PREFIX = "%(stream_src_prefix)s" |
|
26 |
|
27 BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../static/").rstrip("/")+"/" |
|
28 BASE_STATIC_URL = BASE_URL + 'static/' |
|
29 |
|
30 # Absolute path to the directory that holds media. |
|
31 # Example: "/home/media/media.lawrence.com/" |
|
32 MEDIA_ROOT = BASE_STATIC_ROOT + "media/" |
|
33 |
|
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 # Make this unique, and don't share it with anybody. |
|
40 SECRET_KEY = '%(secret_key)s' |
|
41 |
|
42 # PATH to the ffmpeg executable, used to know automatically the media file duration |
|
43 FFMPEG_PATH = "%(ffmpeg_path)s" |
|
44 |
|
45 |
|
46 CONTENT_ROOT = BASE_STATIC_ROOT + "content/" |
|
47 |
|
48 # PATH where uploaded media are put. |
|
49 STREAM_PATH = CONTENT_ROOT |
|
50 |
|
51 LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' |
|
52 |
|
53 |
|
54 |
|
55 DATABASES = { |
|
56 'default': { |
|
57 'ENGINE': 'django.db.backends.%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
58 'NAME': '%(db_name)s', # Or path to database file if using sqlite3. |
|
59 'USER': '%(db_user)s', # Not used with sqlite3. |
|
60 'PASSWORD': '%(db_password)s', # Not used with sqlite3. |
|
61 'HOST': '%(db_host)s', # Set to empty string for localhost. Not used with sqlite3. |
|
62 'PORT': '%(db_port)d', # Set to empty string for default. Not used with sqlite3. |
|
63 } |
|
64 } |
|
65 |
|
66 CACHES = { |
|
67 'default': { |
|
68 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
|
69 } |
|
70 } |
|
71 |
|
72 DEBUG = True |
|
73 TEMPLATE_DEBUG = DEBUG |
|
74 |
|
75 #LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt")) |
|
76 LOG_FILE = '%(log_file)s' |
|
77 LOG_LEVEL = logging.DEBUG |
|
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 } |
|
128 } |
|
129 |
|
130 |
|
131 ADMINS = ( |
|
132 # ('Your Name', 'your_email@domain.com'), |
|
133 ) |
|
134 |
|
135 MANAGERS = ADMINS |
|
136 |
|
137 GOOGLE_ANALYTICS_CODE = '%(google_analytics_code)s' |
|
138 |
|
139 EMAIL_USE_TLS = %(email_use_tls)s |
|
140 EMAIL_HOST = '%(email_host)s' |
|
141 EMAIL_HOST_USER = '%(email_host_user)s' |
|
142 EMAIL_HOST_PASSWORD = '%(email_host_user)s' |
|
143 EMAIL_PORT = %(email_port)d |
|
144 |
|
145 ACCOUNT_ACTIVATION_DAYS = 7 |
|
146 REGISTRATION_OPEN = False |
|
147 |
|
148 LDT_MAX_SEARCH_NUMBER = 50 |
|
149 LDT_MAX_FRAGMENT_PER_SEARCH = 3 |
|
150 LDT_RESULTS_PER_PAGE = 1 |
|
151 LDT_JSON_DEFAULT_INDENT = 0 |
|
152 LDT_MAX_CONTENTS_PER_PAGE = 5 |
|
153 LDT_MAX_PROJECTS_PER_PAGE = 5 |
|
154 LDT_FRONT_MEDIA_PER_PAGE = 9 |
|
155 |
|
156 EMPTY_MEDIA_EXTERNALID = None |
|
157 |
|
158 AUTO_INDEX_AFTER_SAVE = True |
|
159 |
|
160 FORBIDDEN_STREAM_URL = "%(forbidden_stream_url)s" |
|
161 |
|
162 AUDIO_RECORD_URL = "%(audio_record_url)s" |
|
163 |
|
164 FRONT_TAG_LIST = [u"Enmi 2011", u"film", u"conférence"] |
|
165 |
|
166 HAYSTACK_CONNECTIONS = { |
|
167 'default': { |
|
168 #for elasticsearch use ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine |
|
169 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
170 #'URL': 'http://127.0.0.1:9200/', |
|
171 #'INDEX_NAME': 'ldt', |
|
172 }, |
|
173 } |
|
174 |
|
175 LDT_INDEXATION_INSERT_BATCH_SIZE = 5000 |