improve doc and remove warnings

This commit is contained in:
Yun Xu
2017-07-02 10:02:04 -07:00
parent 3fff685c44
commit 5d00717f39
9 changed files with 628 additions and 41 deletions

View File

@@ -195,7 +195,7 @@ class Config(dict):
def load_environment_vars(self):
"""
Looks for any SANIC_ prefixed environment variables and applies
Looks for any ``SANIC_`` prefixed environment variables and applies
them to the configuration if present.
"""
for k, v in os.environ.items():

View File

@@ -206,8 +206,8 @@ class Unauthorized(SanicException):
:param scheme: Name of the authentication scheme to be used.
:param realm: Description of the protected area. (optional)
:param challenge: A dict containing values to add to the WWW-Authenticate
header that is generated. This is especially useful when dealing with the
Digest scheme. (optional)
header that is generated. This is especially useful when dealing with the
Digest scheme. (optional)
"""
pass
@@ -230,9 +230,10 @@ def abort(status_code, message=None):
"""
Raise an exception based on SanicException. Returns the HTTP response
message appropriate for the given status code, unless provided.
:param status_code: The HTTP status code to return.
:param message: The HTTP response body. Defaults to the messages
in response.py for the given status code.
in response.py for the given status code.
"""
if message is None:
message = COMMON_STATUS_CODES.get(status_code,