Update config (#1903)

* New aproach for uploading sanic app config.

* Update config.rst

Co-authored-by: tigerthelion <bjt.thompson@gmail.com>
Co-authored-by: Adam Hopkins <admhpkns@gmail.com>
This commit is contained in:
Tomasz Drożdż
2020-09-30 15:44:09 +02:00
committed by GitHub
parent 7b7559309d
commit 1de4bcef55
10 changed files with 442 additions and 87 deletions

View File

@@ -1452,3 +1452,13 @@ class Sanic:
self.asgi = True
asgi_app = await ASGIApp.create(self, scope, receive, send)
await asgi_app()
# -------------------------------------------------------------------- #
# Configuration
# -------------------------------------------------------------------- #
def update_config(self, config: Union[bytes, str, dict, Any]):
"""Update app.config.
Please refer to config.py::Config.update_config for documentation."""
self.config.update_config(config)