Skip to content

Commit

Permalink
#13: Create config class
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Jul 26, 2019
1 parent 8e414f6 commit c6bcff6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions common/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import json


class Config(object):

def __init__(self):
with open("../config.json") as target:
self.config = json.load(target)
target.close()

def get_db_url(self):
return self.config["DB_URL"]

def get_log_level(self):
return self.config["log_level"]

def is_debug_mode(self):
return self.config["debug_mode"]


config = Config()

0 comments on commit c6bcff6

Please sign in to comment.