-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
49 lines (41 loc) · 1.27 KB
/
config.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
#!/usr/bin/env python
# encoding: utf-8
"""
config.py
Created by 刘 智勇 on 2013-01-26.
Copyright (c) 2013 __MyCompanyName__. All rights reserved.
"""
import os
import redis
from mongokit import Connection
from logging import basicConfig, DEBUG
import uimethods, uimodules
#config settings
settings = dict(
template_path=os.path.join(os.path.dirname(__file__), "htmls"),
static_path=os.path.join(os.path.dirname(__file__), "static"),
cookie_secret="61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
login_url="/account/login",
autoescape="xhtml_escape",
ui_modules=uimodules,
ui_methods=uimethods,
#xsrf_cookies=True,
debug=True,
cache_engine=redis.Redis(host='localhost', port=6379, db=1),
)
#mongodb settings
DB_NAME = 'huwai2'
MONGO_HOST = 'localhost'
MONGO_PORT = 27017
DB_CON = Connection(host=MONGO_HOST, port=MONGO_PORT)
#session initialize settings
SESSION_SET = {
"SESSION_EXPIRE_TIME": 86400, # sessions are valid for 86400 seconds (24 hours)
"REDIS_URL": {'ip': 'localhost', 'port': 6379, 'db': 0, },
}
#loggging config
basicConfig(filename = 'app.log',
format = '%(asctime)s %(module)s %(lineno)s %(message)s',
level = DEBUG
)
TIME_FORMAT = '%Y-%m-%d %H:%M:%S'