Skip to content

Commit

Permalink
增加通过配置文件覆盖配置
Browse files Browse the repository at this point in the history
  • Loading branch information
pjialin committed Jul 12, 2019
1 parent 3a5d10a commit db41aee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ def load(cls):
app = configs.get('app')
if app:
cls.APP_ENV = app.get('env', cls.APP_ENV)
for key, val in app.items():
if key in ['env']:
continue
upper_key = key.upper()
if getattr(cls, upper_key, False):
setattr(cls, upper_key, val)

rules = configs.get('rule')
if rules:
Expand Down

0 comments on commit db41aee

Please sign in to comment.