|
1 # -*- coding: utf-8 -*- |
|
2 import os, logging |
|
3 |
|
4 SITE_ID = 1 |
|
5 |
|
6 #BASE_DIR = os.path.dirname(os.path.abspath(__file__)).rstrip("/")+"/" |
|
7 BASE_DIR = '%(base_dir)s' |
|
8 BASE_URL = '%(base_url)s' |
|
9 WEB_URL = '%(web_url)s' |
|
10 WEB_AUTH = [] # example [{'REGEX': 'localhost/~ymh/platform', 'NAME': 'ymh', 'PASSWORD': 'ymh'}] |
|
11 STATIC_URL = BASE_URL + 'static/site/' |
|
12 |
|
13 |
|
14 STREAM_URL = "%(stream_url)s" |
|
15 |
|
16 STREAM_SRC_PREFIX = "%(stream_src_prefix)s" |
|
17 |
|
18 BASE_STATIC_ROOT = os.path.abspath(BASE_DIR + "../static/").rstrip("/")+"/" |
|
19 BASE_STATIC_URL = BASE_URL + 'static/' |
|
20 |
|
21 # Absolute path to the directory that holds media. |
|
22 # Example: "/home/media/media.lawrence.com/" |
|
23 MEDIA_ROOT = BASE_STATIC_ROOT + "media/" |
|
24 |
|
25 |
|
26 # Absolute path to the directory that static files (js, css, swf...) |
|
27 # DO NOT forget to do command line ./manage.py collectstatic to gather static media into the web/static folder |
|
28 STATIC_ROOT = BASE_STATIC_ROOT + "site/" |
|
29 |
|
30 # PATH to the ffmpeg executable, used to know automatically the media file duration |
|
31 FFMPEG_PATH = "%(ffmpeg_path)s" |
|
32 |
|
33 |
|
34 CONTENT_ROOT = BASE_STATIC_ROOT + "content/" |
|
35 |
|
36 # PATH where uploaded media are put. |
|
37 STREAM_PATH = CONTENT_ROOT |
|
38 |
|
39 ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' |
|
40 LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' |
|
41 |
|
42 |
|
43 |
|
44 DATABASES = { |
|
45 'default': { |
|
46 'ENGINE': 'django.db.backends.%(db_engine)s', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
47 'NAME': '%(db_name)s', # Or path to database file if using sqlite3. |
|
48 'USER': '%(db_user)s', # Not used with sqlite3. |
|
49 'PASSWORD': '%(db_password)s', # Not used with sqlite3. |
|
50 'HOST': '%(db_host)s', # Set to empty string for localhost. Not used with sqlite3. |
|
51 'PORT': '%(db_port)d', # Set to empty string for default. Not used with sqlite3. |
|
52 } |
|
53 } |
|
54 |
|
55 CACHES = { |
|
56 'default': { |
|
57 'BACKEND': 'django.core.cache.backends.dummy.DummyCache', |
|
58 } |
|
59 } |
|
60 |
|
61 DEBUG = True |
|
62 TEMPLATE_DEBUG = DEBUG |
|
63 |
|
64 #LOG_FILE = os.path.abspath(os.path.join(BASE_DIR,"../log/log.txt")) |
|
65 LOG_FILE = '%(log_file)s' |
|
66 LOG_LEVEL = logging.DEBUG |
|
67 LOGGING = { |
|
68 'version': 1, |
|
69 'disable_existing_loggers': False, |
|
70 'formatters' : { |
|
71 'simple' : { |
|
72 'format': "%(asctime)s - %(levelname)s : %(message)s", |
|
73 }, |
|
74 'semi-verbose': { |
|
75 'format': '%(levelname)s %(asctime)s %(module)s %(message)s' |
|
76 }, |
|
77 }, |
|
78 'handlers': { |
|
79 'mail_admins': { |
|
80 'level': 'ERROR', |
|
81 'class': 'django.utils.log.AdminEmailHandler' |
|
82 }, |
|
83 'stream_to_console': { |
|
84 'level': LOG_LEVEL, |
|
85 'class': 'logging.StreamHandler' |
|
86 }, |
|
87 'file': { |
|
88 'level': LOG_LEVEL, |
|
89 'class': 'logging.FileHandler', |
|
90 'filename': LOG_FILE, |
|
91 'formatter': 'semi-verbose', |
|
92 }, |
|
93 }, |
|
94 'loggers': { |
|
95 'django.db.backends':{ |
|
96 'handlers': ['file'], |
|
97 'level': LOG_LEVEL, |
|
98 'propagate': True, |
|
99 }, |
|
100 'django.request': { |
|
101 'handlers': ['file'], |
|
102 'level': LOG_LEVEL, |
|
103 'propagate': True, |
|
104 }, |
|
105 'ldt': { |
|
106 'handlers': ['file'], |
|
107 'level': LOG_LEVEL, |
|
108 'propagate': True, |
|
109 }, |
|
110 } |
|
111 } |
|
112 |
|
113 |
|
114 ADMINS = ( |
|
115 # ('Your Name', 'your_email@domain.com'), |
|
116 ) |
|
117 |
|
118 MANAGERS = ADMINS |
|
119 |
|
120 GOOGLE_ANALYTICS_CODE = '%(google_analytics_code)s' |
|
121 |
|
122 EMAIL_USE_TLS = %(email_use_tls)s |
|
123 EMAIL_HOST = '%(email_host)s' |
|
124 EMAIL_HOST_USER = '%(email_host_user)s' |
|
125 EMAIL_HOST_PASSWORD = '%(email_host_user)s' |
|
126 EMAIL_PORT = %(email_port)d |
|
127 |
|
128 ACCOUNT_ACTIVATION_DAYS = 7 |
|
129 REGISTRATION_OPEN = False |
|
130 |
|
131 LDT_MAX_SEARCH_NUMBER = 50 |
|
132 LDT_MAX_FRAGMENT_PER_SEARCH = 3 |
|
133 LDT_RESULTS_PER_PAGE = 1 |
|
134 LDT_JSON_DEFAULT_INDENT = 0 |
|
135 LDT_MAX_CONTENTS_PER_PAGE = 5 |
|
136 LDT_MAX_PROJECTS_PER_PAGE = 5 |
|
137 LDT_FRONT_MEDIA_PER_PAGE = 9 |
|
138 |
|
139 EMPTY_MEDIA_EXTERNALID = None |
|
140 |
|
141 AUTO_INDEX_AFTER_SAVE = True |
|
142 |
|
143 FORBIDDEN_STREAM_URL = "%(forbidden_stream_url)s" |
|
144 |
|
145 FRONT_TAG_LIST = [u"Enmi 2011", u"film", u"conférence"] |
|
146 |
|
147 HAYSTACK_CONNECTIONS = { |
|
148 'default': { |
|
149 #for elasticsearch use ldt.indexation.backends.elasticsearch_backend.ElasticsearchSearchEngine |
|
150 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', |
|
151 #'URL': 'http://127.0.0.1:9200/', |
|
152 #'INDEX_NAME': 'ldt', |
|
153 }, |
|
154 } |