Merge pull request #1436 from jotagesales/config_from_object_string

Config from object string
This commit is contained in:
7
2019-06-16 16:58:43 -07:00
committed by GitHub
5 changed files with 72 additions and 5 deletions

View File

@@ -53,6 +53,13 @@ import myapp.default_settings
app = Sanic('myapp')
app.config.from_object(myapp.default_settings)
```
or also by path to config:
```
app = Sanic('myapp')
app.config.from_object('config.path.config.Class')
```
You could use a class or any other object as well.