-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
36 lines (29 loc) · 1 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
import os
from dotenv import load_dotenv
load_dotenv()
class Config:
SHARED_FOLDER = os.getenv('SHARED_FOLDER', 'C:\\Users\\(Username)\\Desktop\\SharedFolder')
UPLOAD_FOLDER = os.path.join(SHARED_FOLDER, 'uploads')
TEXT_FILE = os.path.join(SHARED_FOLDER, 'text.json')
URLS_FILE = os.path.join(SHARED_FOLDER, 'urls.txt')
IP_ADDRESS = os.getenv('IP_ADDRESS', '0.0.0.0')
PORT = int(os.getenv('PORT', 8000))
DEBUG = os.getenv('DEBUG', 'True').lower() in ['true', '1', 't']
SSL_CERT = os.getenv('SSL_CERT', os.path.join('certs', 'selfsigned.crt'))
SSL_KEY = os.getenv('SSL_KEY', os.path.join('certs', 'selfsigned.key'))
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
class TestingConfig(Config):
TESTING = True
DEBUG = True
class ProductionConfig(Config):
DEBUG = False
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': ProductionConfig
}