-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
71 lines (60 loc) · 1.6 KB
/
settings.py
File metadata and controls
71 lines (60 loc) · 1.6 KB
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
# db = {
# 'driver': 'postgresql+psycopg2',
# 'bd_name': '',
# 'username': '',
# 'password': '',
# 'host': '',
# 'port': '',
# }
#
# tornado_settings = {
# 'login_url': "/manage",
# 'cookie_secret': "",
# 'xsrf_cookies': False, # !!
# 'autoreload': False,
# 'debug': False,
# 'media': 'media',
# 'password_salt': '',
# }
#
# recaptcha_settings = {
# 'public_key': '',
# 'private_key': ''
# }
import os, sys
from jinja2 import Environment, FileSystemLoader, StrictUndefined
from sqlalchemy_imageattach.stores.fs import FileSystemStore
from tornado_jinja2 import Jinja2Loader
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
STATIC_PATH = '%s/static/' % SITE_ROOT
MEDIA_PATH = '%s/media/' % SITE_ROOT
store = FileSystemStore(
path=MEDIA_PATH,
base_url='/media/'
)
TEMPLATE_PATH = '%s/templates' % SITE_ROOT
jinja2_settings = {
'autoescape': True,
'extensions': [
'jinja2.ext.with_'
],
}
jinja2_environment = Environment(
loader=FileSystemLoader(TEMPLATE_PATH),
undefined=StrictUndefined,
**jinja2_settings
)
jinja2loader = Jinja2Loader(TEMPLATE_PATH)
settings = dict(
template_path=TEMPLATE_PATH,
static_path=STATIC_PATH,
template_loader=jinja2loader
)
# to settings_local
# email_settings = {
# 'from': 'Ech.su! <noreply@ech.su>',
# 'username': 'noreply@ech.su',
# 'password': '',
# 'smtp': 'smtp.yandex.ru:587'
# }
#bing_api_key = ''