-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
33 lines (25 loc) · 826 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
import os
from datetime import timedelta
from dotenv import load_dotenv
load_dotenv()
class Config:
SECRET_KEY = os.getenv("SECRET_KEY")
JWT_SECRET_KEY = os.getenv("JWT_SECRET_KEY")
JWT_ACCESS_TOKEN_EXPIRES = timedelta(minutes = int(os.getenv("JWT_ACCESS_TOKEN_EXPIRES")))
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
# * Configuration used in development environments only
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.getenv("DEV_DATABASE_URL")
class TestingConfig(Config):
# * Configuration used in unit and integration testing
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = os.getenv("TESTING_DATABASE_URL")
config = {
"development" : DevelopmentConfig,
"testing" : TestingConfig,
"default" : DevelopmentConfig
}