-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
37 lines (31 loc) · 1014 Bytes
/
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
import os
DEBUG = True
BIND_TO_OUTSIDE_IP = False
BIND_TO_PORT = 8080
ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
APP_PATH = os.path.join(ROOT_PATH, "app")
RESOURCES_PATH = os.path.join(APP_PATH, "resources")
BASE_TEMPLATE_PATH = os.path.join(APP_PATH, "views")
SESSION_PATH = os.path.join(APP_PATH, "sessions")
ENV = "dev"
DBNAME = "medformme"
ENVIRONMENTS = {
"dev": "sqlite:///%s/%s.db" % (ROOT_PATH, DBNAME),
"test": "sqlite:///%s/%s.db" % (ROOT_PATH, DBNAME),
"beta": "sqlite:///%s/%s.db" % (ROOT_PATH, DBNAME),
"demo": "mysql://root:password@localhost/%s" % DBNAME,
"prod": "mysql://root:password@localhost/%s" % DBNAME
}
DB_CONNECTION_STRING = ENVIRONMENTS[ENV]
#
# Session settings
#
SESSION_OPTS = {
"session.type": "ext:database",
"session.cookie_expires": 14400,
"session.auto": True,
"session.url": DB_CONNECTION_STRING,
"session.table_name": "admin_session",
"session.lock_dir": os.path.join(SESSION_PATH, "lock"),
"session.data_dir": os.path.join(SESSION_PATH, "data")
}