Merge pull request #819 from r0fls/817
convert environment vars to int if digits
This commit is contained in:
commit
529f5822ee
|
@ -201,4 +201,10 @@ class Config(dict):
|
|||
for k, v in os.environ.items():
|
||||
if k.startswith(SANIC_PREFIX):
|
||||
_, config_key = k.split(SANIC_PREFIX, 1)
|
||||
try:
|
||||
self[config_key] = int(v)
|
||||
except ValueError:
|
||||
try:
|
||||
self[config_key] = float(v)
|
||||
except ValueError:
|
||||
self[config_key] = v
|
||||
|
|
Loading…
Reference in New Issue
Block a user