forked from Simple2B/babybots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
59 lines (42 loc) · 1.56 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
50
51
52
53
54
55
56
57
58
59
import os
base_dir = os.path.dirname(os.path.abspath(__file__))
class BaseConfig(object):
"""Base configuration."""
APP_NAME = "SwishDurham Pricing Application"
DEBUG_TB_ENABLED = False
SECRET_KEY = os.environ.get(
"SECRET_KEY", "Ensure you set a secret key, this is important!"
)
SQLALCHEMY_TRACK_MODIFICATIONS = False
WTF_CSRF_ENABLED = False
ADMIN_USER_NAME = os.environ.get("ADMIN_USER_NAME", "admin")
ADMIN_USER_EMAIL = os.environ.get("ADMIN_USER_EMAIL", "admin@admin.com")
ADMIN_USER_PASS = os.environ.get("ADMIN_USER_PASS", "admin")
@staticmethod
def configure(app):
# Implement this method to do further configuration on your app.
pass
class DevelopmentConfig(BaseConfig):
"""Development configuration."""
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DEVEL_DATABASE_URL",
"sqlite:///" + os.path.join(base_dir, "database-devel.sqlite3"),
)
class TestingConfig(BaseConfig):
"""Testing configuration."""
TESTING = True
PRESERVE_CONTEXT_ON_EXCEPTION = False
SQLALCHEMY_DATABASE_URI = os.environ.get(
"TEST_DATABASE_URL",
"sqlite:///" + os.path.join(base_dir, "database-test.sqlite3"),
)
class ProductionConfig(BaseConfig):
"""Production configuration."""
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL", "sqlite:///" + os.path.join(base_dir, "database.sqlite3")
)
WTF_CSRF_ENABLED = False
config = dict(
development=DevelopmentConfig, testing=TestingConfig, production=ProductionConfig
)