-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.py
336 lines (269 loc) · 9.43 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# -*- coding=utf-8 -*-
import os, sys
import logging
sys.path.append('/opt/ebs/data/workers/')
DEBUG = True
DEBUG_SQL=False
TEMPLATE_DEBUG = DEBUG
USE_TZ = False
ADMINS = (
#('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'NAME': 'ebs',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'ebs',
'PASSWORD': 'ebspassword',
'HOST': "127.0.0.1",
'PORT':5432,
},
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
}
}
# system time zone.
TIME_ZONE = None # This will use system timezone. Don`t touch this.
LANGUAGE_CODE = 'ru-RU'
SITE_ID = 1
USE_I18N = True
USE_l10N = True
MEDIA_URL = '/media/'
DATETIME_FORMAT = "d.m.Y H:i:s"
SHORT_DATETIME_FORMAT = "d.m.Y H:i:s"
STATIC_URL = '/static/'
STATIC_ROOT = '/opt/ebs/web/ebscab/static'
ADMIN_MEDIA_PREFIX = '/admin_media/'
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
# Make this unique, and don't share it with anybody.
SECRET_KEY = '%!a5^gik_4lgzt+k)vyo6)y68_3!u^*j(ujks7(=6f2j89d=x&'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '#g7(r6=^+7+h6x2_sb)mqydjk6c_!m*d%#na=qtkca$05tx#$8'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'notification.context_processors.auth',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.contrib.messages.context_processors.messages',
'lib.context_processors.default_current_view_name',
'lib.context_processors.project_settings',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.transaction.TransactionMiddleware',
#'lib.threadlocals.ThreadLocalsMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
#'billservice.middleware.UrlFilter',
'ebsadmin.middleware.Version'
)
ROOT_URLCONF = 'ebscab.urls'
TEMPLATE_DIRS = (
'/opt/ebs/web/ebscab/templates',
#'/opt/ebs/web/ebscab/helpdesk/templates',
'%s/templates/' % os.path.abspath('.'),
)
LOCALE_PATHS = (
os.path.abspath('locale'),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.staticfiles',
'radius',
'nas',
'billservice',
'lib',
'statistics',
'paymentgateways.webmoney',
'helpdesk',
'object_log',
'django_tables2',
'crispy_forms',
'dynamicmodel',
'ajax_select',
'ebsadmin',
'django_tables2_reports',
'getpaid',
'sendsms',
'autocomplete_light',
'selectable',
'mathfilters',
'captcha',
)
AJAX_LOOKUP_CHANNELS = {
# pass a dict with the model and the field to search against
'account_fts' : ('billservice.lookups', 'AccountFTSLookup'),
'account_fullname' : ('billservice.lookups', 'AccountFullnameLookup'),
'account_username' : ('billservice.lookups', 'AccountUsernameLookup'),
'account_contract': ('billservice.lookups', 'AccountContractLookup'),
'account_contactperson': ('billservice.lookups', 'AccountContactPersonLookup'),
'city_name': ('billservice.lookups', 'CityLookup'),
'street_name': ('billservice.lookups', 'StreetLookup'),
'house_name': ('billservice.lookups', 'HouseLookup'),
'hardware_fts': ('billservice.lookups', 'HardwareLookup'),
'organization_name': ("billservice.lookups", "OrganizationLookup"),
'subaccount_fts': ('billservice.lookups', 'SubAccountFTSLookup')
}
AJAX_SELECT_BOOTSTRAP = False
AJAX_SELECT_INLINES = 'inline'
AUTHENTICATION_BACKENDS = (
#'helpdesk.backend.LoginSystemUserBackend',
'billservice.backend.LoginUserBackend',
)
#credentials generation rules
LOGIN_LENGTH=8
PASSWORD_LENGTH=8
LOGIN_CONTAIN_LETTERS=True
LOGIN_CONTAIN_DIGITS=True
PASSWORD_CONTAIN_LETTERS=False
PASSWORD_CONTAIN_DIGITS=True
PGCRYPTO_VALID_CIPHERS = ('AES', )
PGCRYPTO_DEFAULT_CIPHER = 'AES'
PGCRYPTO_DEFAULT_KEY = 'ebscryptkeytest'
LOG_LEVEL = 0
CACHE_BACKEND = 'locmem:///'
SESSION_EXPIRE_AT_BROWSER_CLOSE=True
LOGIN_URL = '/login/'
LOGOUT_URL = '/logout/'
LOGIN_REDIRECT_URL = '/login/'
ALLOW_PROMISE = True
MAX_PROMISE_SUM = 10000
MIN_BALLANCE_FOR_PROMISE=-1000
LEFT_PROMISE_DAYS = 7
PROMISE_REACTIVATION_DAYS = 28
ALLOW_WEBMONEY = False
ALLOW_QIWI = False
QIWI_MIN_SUMM=30
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'userpassword'
HIDE_PASSWORDS = False
ENABLE_SELECT2_MULTI_PROCESS_SUPPORT = False
CURRENCY = u' руб'
HOTSPOT_ONLY_PIN = False
GETPAID_BACKENDS = (#'getpaid.backends.easypay',
#'getpaid.backends.platezhkaua',
)
PROVIDER_LOGO = 'img/ebs.jpg' # in media dir
GETPAID_BACKENDS_SETTINGS = {
# Please provide your settings for backends
'payments.liqpay' : {
'TYPE': 'frontend',
'DEFAULT_CURRENCY' : 'UAH',
'MERCHANT_ID': '',
'MERCHANT_SIGNATURE': '',
'PAY_WAY': ('card', 'liqpay', 'delayed'),
'EXPIRE_TIME': 36,
},
'payments.easypay' : {
'TYPE': 'backend',
'DEFAULT_CURRENCY' : 'UAH',
'SERVICE_ID' : '1',
'allowed_ip': ('93.183.196.28', '93.183.196.26'),
},
'payments.ru_sberbank' : {
'TYPE': 'backend',
'DEFAULT_CURRENCY' : 'RUB',
'PASSWORD' : '12345',
'allowed_ip': ('93.183.196.28', '93.183.196.26'),
},
'payments.masterplat' : {
'TYPE': 'backend',
'DEFAULT_CURRENCY' : 'RUB',
'DUSER' : '12345',
'DPASS': '12345',
},
'payments.platezhkaua' : {
'TYPE': 'backend',
'DEFAULT_CURRENCY' : 'UAH',
'LOGIN' : '12345',
'PASSWORD': '12345',
}
}
SENDSMS_BACKENDS = (
('sendsms.backends.websms.SmsBackend', 'websms.ru'),
('sendsms.backends.smsru.SmsBackend', 'sms.ru'),
('sendsms.backends.smspilotru.SmsBackend', 'smspilot.ru'),
)
SENDSMS_BACKENDS_SETTINGS = {
'sendsms.backends.websms': {
'FROM_NAME': '', # http://websms.ru/FromName.asp
'USERNAME': '',
'PASSWORD': '',
},
'sendsms.backends.smsru': {
'FROM_NAME': '',
'API_ID': '',
'TRANSLIT': '1',
'TEST': '0',
'PARTNER_ID': '',
},
'sendsms.backends.smspilotru': {
'FROM_NAME': '',
'API_ID': '',
}
}
SENDSMS_IF_BALLANCE_AMOUNT = 0
SENDSMS_NOT_SEND_IF_BALANCE_LESS=-10000
SENDSMS_SEND_EVERY_N_DAY=5
SENDSMS_DEFAULT_BACKEND = 'sendsms.backends.websms.SmsBackend'
SENDSMS_DEFAULT_FROM_PHONE = '+11111111111'
TEST_RUNNER = 'django.test.simple.DjangoTestSuiteRunner'
CAPTCHA_FONT_SIZE = 18
#CAPTCHA_FONT_PATH = 'media/LiberationSans-Regular.ttf'
CAPTCHA_LETTER_ROTATION = (-1,1)
CAPTCHA_NOISE_FUNCTIONS = ('captcha.helpers.noise_dots',)
#TEST_RUNNER = 'testrunner.NoDbTestRunner'
PERSONAL_AREA_STAFF_MENU = [
('helpdesk_dashboard', u"Сводка", ''),
('helpdesk_list', u"Заявки", ''),
('helpdesk_submit', u"Создать заявку", 'modal-queue-dialog'),
('helpdesk_kb_index', u"База знаний", ''),
('helpdesk_report_index', u"Статистика", ''),
('helpdesk_user_settings', u"Ваши настройки", ''),
('/admin/', u"Конфигурация", ''),
('account_logout', u'Выход', ''),
]
# load local_settings
try:
from settings_local import *
import settings_local
INSTALLED_APPS += settings_local.GETPAID_BACKENDS if 'GETPAID_BACKENDS' in settings_local.__dict__ else ()
except Exception, ex:
print ex
# define logging
if DEBUG:
LEVEL = logging.DEBUG
else:
LEVEL = logging.INFO
PROJECT_DIR = os.path.dirname(__file__)
logging.basicConfig(level=LEVEL,
format='%(asctime)s %(name)s %(levelname)s %(message)s',
filename=os.path.join(PROJECT_DIR, 'log/django.log'),
filemode='a+')
root = logging.basicConfig()