added docstring to helper function import_string

This commit is contained in:
Jotagê Sales
2018-12-27 14:35:04 -02:00
parent 375ebd39f0
commit bf029c1b9d
2 changed files with 18 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import types
from sanic.exceptions import PyFileError
from sanic.helpers import import_string
SANIC_PREFIX = "SANIC_"
@@ -104,6 +105,9 @@ class Config(dict):
from yourapplication import default_config
app.config.from_object(default_config)
or also:
app.config.from_object('myproject.config.MyConfigClass')
You should not use this function to load the actual configuration but
rather configuration defaults. The actual config should be loaded
with :meth:`from_pyfile` and ideally from a location not within the