forked from bueda/tornado-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
46 lines (37 loc) · 979 Bytes
/
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
import os
import logging
import logging.handlers
import redis
import tornado
import tornado.template
import tornado.options
from tornado.options import define, options
SECRET_KEY = 'tornado.app'
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
TEMPLATE_ROOT = os.path.join(BASE_DIR, 'templates')
settings = dict(
title="Tornado server",
debug=True,
static_root=STATIC_ROOT,
cookie_secret='your-cookie-secret',
xsrf_cookies=True,
login_url="/auth/login",
template_path=TEMPLATE_ROOT,
template_loader=tornado.template.Loader(TEMPLATE_ROOT),
)
settings['session'] = dict(
session_id_name='token',
expire_seconds=60 * 60 * 1,
backend=redis.StrictRedis(host='127.0.0.1', port=6379, db=0),
)
settings['database'] = dict(
host='127.0.0.1',
db='db',
user='user',
password='***',
)
settings['media'] = dict(
root='/opt/media/crm/',
url='/media/',
)