-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
48 lines (35 loc) · 1.36 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
import os
host = os.environ.get('APP_HOST', '0.0.0.0')
port = os.environ.get('APP_PORT', 7100)
db_name = os.environ.get('DB_NAME', 'testdb')
db_user = os.environ.get('DB_USER', 'test')
db_password = os.environ.get('DB_PASSWORD', 'password')
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = 'XXXXX' #todo: should be changed for production
SQLALCHEMY_DATABASE_URI = "postgresql://{}:{}@database:5432/{}".format(db_user, db_password, db_name)
SQLALCHEMY_TRACK_MODIFICATIONS = False
SECURITY_URL_PREFIX = "/admin"
SECURITY_PASSWORD_HASH = "pbkdf2_sha512"
SECURITY_PASSWORD_SALT = "YYYYYYY" #todo: should be changed for production
SECURITY_LOGIN_URL = "/login/"
SECURITY_LOGOUT_URL = "/logout/"
SECURITY_REGISTER_URL = "/register/"
SECURITY_RESET_URL = "/reset/"
SECURITY_POST_LOGIN_VIEW = "/admin/"
SECURITY_POST_LOGOUT_VIEW = "/admin/"
SECURITY_POST_REGISTER_VIEW = "/admin/"
SECURITY_POST_RESET_VIEW = "/admin/"
SECURITY_REGISTERABLE = True
SECURITY_RECOVERABLE = True
SECURITY_CHANGEABLE = True
SECURITY_SEND_REGISTER_EMAIL = False
class ProductionConfig(Config):
DEBUG = False
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
configs = {"dev": DevelopmentConfig, "prod": ProductionConfig}
config = configs[os.environ.get('ENV', 'dev')]