New aproach for uploading sanic app config.

This commit is contained in:
tomaszdrozdz 2020-08-04 18:30:35 +02:00
parent ae124204dd
commit 8a51b97cb4
2 changed files with 28 additions and 20 deletions

View File

@ -1469,7 +1469,10 @@ class Sanic:
A = 1
B = 2
app.update_config("/some/py/file")
app.update_config("${some}/py/file")
Yes you can put environment variable here, but they must be provided in format: ${some_env_var},
and mark that $some_env_var is treated as plain string.
You can upload app config by providing dict holding settings.

View File

@ -90,7 +90,10 @@ class Config(dict):
A = 1
B = 2
config.update_config("/some/py/file")
config.update_config("${some}/py/file")
Yes you can put environment variable here, but they must be provided in format: ${some_env_var},
and mark that $some_env_var is treated as plain string.
You can upload app config by providing dict holding settings.
@ -144,7 +147,9 @@ def load_module_from_file_location(*args, **kwargs):
:param kwargs: look for importlib.util.spec_from_file_location parameters specification
So for example You can:
some_module = load_module_from_file_location("some_module_name", "/some/path/${some_env_var})
Yes you can put environment variable here, but they must be provided in format: ${some_env_var},
and mark that $some_env_var is treated as plain string."""