-
Notifications
You must be signed in to change notification settings - Fork 194
/
config.py
42 lines (31 loc) · 1.08 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
from os import environ
class Config(object):
SECRET_KEY = 'key'
SQLALCHEMY_DATABASE_URI = 'sqlite:///database.db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# THEME SUPPORT
# if set then url_for('static', filename='', theme='')
# will add the theme name to the static URL:
# /static/<DEFAULT_THEME>/filename
# DEFAULT_THEME = "themes/dark"
DEFAULT_THEME = None
class ProductionConfig(Config):
DEBUG = False
# Security
SESSION_COOKIE_HTTPONLY = True
REMEMBER_COOKIE_HTTPONLY = True
REMEMBER_COOKIE_DURATION = 3600
# PostgreSQL database
SQLALCHEMY_DATABASE_URI = 'postgresql://{}:{}@{}:{}/{}'.format(
environ.get('GENTELELLA_DATABASE_USER', 'gentelella'),
environ.get('GENTELELLA_DATABASE_PASSWORD', 'gentelella'),
environ.get('GENTELELLA_DATABASE_HOST', 'db'),
environ.get('GENTELELLA_DATABASE_PORT', 5432),
environ.get('GENTELELLA_DATABASE_NAME', 'gentelella')
)
class DebugConfig(Config):
DEBUG = True
config_dict = {
'Production': ProductionConfig,
'Debug': DebugConfig
}