-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
55 lines (41 loc) · 1.42 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
from os import environ
class BaseConfig(object):
"""Base configuration."""
DEBUG = None
DB_HOST = "bd_name"
DB_USER = "db_user"
DB_PASS = "db_pass"
DB_NAME = "db_name"
SECRET_KEY = "secret"
@staticmethod
def configure(app):
# Implement this method to do further configuration on your app.
pass
class DevelopmentConfig(BaseConfig):
"""Development configuration."""
ENV = "development"
DEBUG = environ.get("DEBUG", True)
DB_HOST = environ.get("DB_HOST", "localhost")
DB_USER = environ.get("DB_USER", "root")
DB_PASS = environ.get("DB_PASS", "")
DB_NAME = environ.get("DB_NAME", "home_sweet_home")
class TestingConfig(BaseConfig):
"""Testing configuration."""
ENV = "testing"
TESTING = True
DEBUG = environ.get("DEBUG", True)
DB_HOST = environ.get("DB_HOST", "localhost")
DB_USER = environ.get("DB_USER", "root")
DB_PASS = environ.get("DB_PASS", "")
DB_NAME = environ.get("DB_NAME", "home_sweet_home")
class ProductionConfig(BaseConfig):
"""Production configuration."""
ENV = "production"
DEBUG = environ.get("DEBUG", False)
DB_HOST = environ.get("DB_HOST", "localhost")
DB_USER = environ.get("DB_USER", "root")
DB_PASS = environ.get("DB_PASS", "")
DB_NAME = environ.get("DB_NAME", "home_sweet_home")
config = dict(
development=DevelopmentConfig, testing=TestingConfig, production=ProductionConfig
)