change config load method to support custom configs

This commit is contained in:
yanyongyu
2020-08-07 11:18:02 +08:00
parent 10221520d9
commit 5186231869
2 changed files with 79 additions and 4 deletions

View File

@ -29,7 +29,7 @@ def get_asgi():
return driver.asgi
def init(*, _env_file=None, **kwargs):
def init(*, _env_file: Optional[str] = None, **kwargs):
global _driver
env = Env()
config = Config(**kwargs, _env_file=_env_file or f".env.{env.environment}")