-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
58 lines (49 loc) · 1.29 KB
/
config.py
File metadata and controls
58 lines (49 loc) · 1.29 KB
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
from os import environ, path
from dotenv import load_dotenv
basedir = path.abspath(path.join(path.dirname(__file__), ''))
load_dotenv()
class Config:
APP_NAME = environ.get('APP_NAME')
API_KEY = environ.get('API_KEY')
SECRET_KEY = environ.get('API_KEY')
SQLALCHEMY_DATABASE_URI = environ.get('DATABASE_URI') \
or 'sqlite:///' + path.join(basedir, 'db/app.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False
migrations = path.join(basedir, "migrations")
server_ip = "127.0.0.1"
server_port = "7070"
flask_debug = True
LOG_DIR = path.join(basedir, 'logs/')
LOG_FILENAME = "tasker.log"
# TODO
# update the code to use config parser and a config file
# https://docs.python.org/3/library/configparser.html
# TODO
# create class setter and getter values for config specifics
# set a config value, then update the config file
# class Development(Config):
# ''' Development config. '''
#
# DEBUG = True
# ENV = 'dev'
#
#
# class Staging(Config):
# ''' Staging config. '''
#
# DEBUG = True
# ENV = 'staging'
#
#
# class Production(Config):
# ''' Production config '''
#
# DEBUG = False
# ENV = 'production'
#
#
# config = {
# 'development': Development,
# 'staging': Staging,
# 'production': Production,
# }