0
|
1 |
# -*- coding: utf-8 -*- |
|
2 |
import os, logging |
|
3 |
|
|
4 |
SITE_ID = 1 |
|
5 |
|
1
|
6 |
#configuration for runserver |
|
7 |
#BASE_URL = '/' |
|
8 |
#PLATFORM_BASE_URL = '/' |
|
9 |
#WEB_URL = '' |
|
10 |
#WEB_AUTH = [] |
|
11 |
|
|
12 |
|
|
13 |
|
0
|
14 |
#BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" |
|
15 |
BASE_DIR = '%(base_dir)s' |
|
16 |
BASE_URL = '%(base_url)s' |
1
|
17 |
PLATFORM_BASE_URL = BASE_URL + 'ldtplatform/' |
0
|
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 |
# PATH to the ffmpeg executable, used to know automatically the media file duration |
|
40 |
FFMPEG_PATH = "%(ffmpeg_path)s" |
|
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 |
|
|
53 |
DATABASES = { |
|
54 |
'default': { |
|
55 |
'ENGINE': 'django.db.backends.%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
56 |
'NAME': '%(db_name)s', # Or path to database file if using sqlite3. |
|
57 |
'USER': '%(db_user)s', # Not used with sqlite3. |
|
58 |
'PASSWORD': '%(db_password)s', # Not used with sqlite3. |
|
59 |
'HOST': '%(db_host)s', # Set to empty string for localhost. Not used with sqlite3. |
|
60 |
'PORT': '%(db_port)d', # Set to empty string for default. Not used with sqlite3. |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
64 |
CACHES = { |
|
65 |
'default': { |
|
66 |
'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
|
67 |
} |
|
68 |
} |
|
69 |
|
|
70 |
DEBUG = True |
|
71 |
TEMPLATE_DEBUG = DEBUG |
|
72 |
|
14
|
73 |
#LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../../run/log/log.txt")) |
0
|
74 |
LOG_FILE = '%(log_file)s' |
|
75 |
LOG_LEVEL = logging.DEBUG |
|
76 |
LOGGING = { |
|
77 |
'version': 1, |
|
78 |
'disable_existing_loggers': False, |
|
79 |
'formatters' : { |
|
80 |
'simple' : { |
|
81 |
'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
82 |
}, |
|
83 |
'semi-verbose': { |
|
84 |
'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
85 |
}, |
|
86 |
}, |
|
87 |
'handlers': { |
|
88 |
'mail_admins': { |
|
89 |
'level': 'ERROR', |
|
90 |
'class': 'django.utils.log.AdminEmailHandler' |
|
91 |
}, |
|
92 |
'stream_to_console': { |
|
93 |
'level': LOG_LEVEL, |
|
94 |
'class': 'logging.StreamHandler' |
|
95 |
}, |
|
96 |
'file': { |
|
97 |
'level': LOG_LEVEL, |
|
98 |
'class': 'logging.FileHandler', |
|
99 |
'filename': LOG_FILE, |
|
100 |
'formatter': 'semi-verbose', |
|
101 |
}, |
|
102 |
}, |
|
103 |
'loggers': { |
|
104 |
'django.db.backends':{ |
|
105 |
'handlers': ['file'], |
|
106 |
'level': LOG_LEVEL, |
|
107 |
'propagate': True, |
|
108 |
}, |
|
109 |
'django.request': { |
|
110 |
'handlers': ['file'], |
|
111 |
'level': LOG_LEVEL, |
|
112 |
'propagate': True, |
|
113 |
}, |
|
114 |
'ldt': { |
|
115 |
'handlers': ['file'], |
|
116 |
'level': LOG_LEVEL, |
|
117 |
'propagate': True, |
|
118 |
}, |
|
119 |
} |
|
120 |
} |
|
121 |
|
|
122 |
|
|
123 |
ADMINS = ( |
|
124 |
# ('Your Name', 'your_email@domain.com'), |
|
125 |
) |
|
126 |
|
|
127 |
MANAGERS = ADMINS |
|
128 |
|
|
129 |
GOOGLE_ANALYTICS_CODE = '%(google_analytics_code)s' |
|
130 |
|
|
131 |
EMAIL_USE_TLS = %(email_use_tls)s |
|
132 |
EMAIL_HOST = '%(email_host)s' |
|
133 |
EMAIL_HOST_USER = '%(email_host_user)s' |
|
134 |
EMAIL_HOST_PASSWORD = '%(email_host_user)s' |
|
135 |
EMAIL_PORT = %(email_port)d |
|
136 |
|
|
137 |
ACCOUNT_ACTIVATION_DAYS = 7 |
|
138 |
REGISTRATION_OPEN = False |
|
139 |
|
|
140 |
LDT_MAX_SEARCH_NUMBER = 50 |
|
141 |
LDT_MAX_FRAGMENT_PER_SEARCH = 3 |
|
142 |
LDT_RESULTS_PER_PAGE = 1 |
|
143 |
LDT_JSON_DEFAULT_INDENT = 0 |
|
144 |
LDT_MAX_CONTENTS_PER_PAGE = 5 |
|
145 |
LDT_MAX_PROJECTS_PER_PAGE = 5 |
|
146 |
LDT_FRONT_MEDIA_PER_PAGE = 9 |
|
147 |
|
|
148 |
EMPTY_MEDIA_EXTERNALID = None |
|
149 |
|
|
150 |
AUTO_INDEX_AFTER_SAVE = True |
|
151 |
|
|
152 |
FORBIDDEN_STREAM_URL = "%(forbidden_stream_url)s" |
|
153 |
|
|
154 |
FRONT_TAG_LIST = [u"Enmi 2011", u"film", u"conférence"] |
|
155 |
|
|
156 |
HAYSTACK_CONNECTIONS = { |
|
157 |
'default': { |
|
158 |
#for elasticsearch use ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine |
|
159 |
'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
160 |
#'URL': 'http://127.0.0.1:9200/', |
|
161 |
#'INDEX_NAME': 'ldt', |
|
162 |
}, |
|
163 |
} |