-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
48 lines (35 loc) · 1.12 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
#!/usr/bin/env python3
# 3rd party modules
from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.dirname(__file__))
load_dotenv() # Initializes dotenv
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
DATA_DIR = 'data'
DATA_CSV = f'{DATA_DIR}/data.csv'
DATA_JSON = f'{DATA_DIR}/data.json'
class ProductionConfig(Config):
# Don't actually use this for real production with Flask alone
DEBUG = False
FLASK_IP = environ.get('PROD_FLASK_IP')
FLASK_PORT = environ.get('PROD_FLASK_PORT')
HOUR_LIMIT, MINUTE_LIMIT, SECOND_LIMIT = 1000, 100, 10
class StagingConfig(Config):
DEVELOPMENT = True
DEBUG = False
RELOADER = False
FLASK_IP = environ.get('PROD_FLASK_IP')
FLASK_PORT = environ.get('PROD_FLASK_PORT')
HOUR_LIMIT, MINUTE_LIMIT, SECOND_LIMIT = 1000, 100, 10
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
RELOADER = False
FLASK_IP = environ.get('DEV_FLASK_IP')
FLASK_PORT = environ.get('DEV_FLASK_PORT')
class TestingConfig(Config):
TESTING = True
RELOADER = False