New aproach for uploading sanic app config.
This commit is contained in:
parent
ae124204dd
commit
8a51b97cb4
@ -1469,7 +1469,10 @@ class Sanic:
|
|||||||
A = 1
|
A = 1
|
||||||
B = 2
|
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.
|
You can upload app config by providing dict holding settings.
|
||||||
|
|
||||||
|
@ -90,7 +90,10 @@ class Config(dict):
|
|||||||
A = 1
|
A = 1
|
||||||
B = 2
|
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.
|
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
|
:param kwargs: look for importlib.util.spec_from_file_location parameters specification
|
||||||
|
|
||||||
So for example You can:
|
So for example You can:
|
||||||
|
|
||||||
some_module = load_module_from_file_location("some_module_name", "/some/path/${some_env_var})
|
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},
|
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."""
|
and mark that $some_env_var is treated as plain string."""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user