Merge pull request #11 from channelcat/master
merge upstream master branch
This commit is contained in:
commit
747c21da70
|
@ -31,13 +31,13 @@ Hello World Example
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
- ``python -m pip install sanic``
|
- ``pip install sanic``
|
||||||
|
|
||||||
To install sanic without uvloop or json using bash, you can provide either or both of these environmental variables
|
To install sanic without uvloop or json using bash, you can provide either or both of these environmental variables
|
||||||
using any truthy string like `'y', 'yes', 't', 'true', 'on', '1'` and setting the NO_X to true will stop that features
|
using any truthy string like `'y', 'yes', 't', 'true', 'on', '1'` and setting the NO_X to true will stop that features
|
||||||
installation.
|
installation.
|
||||||
|
|
||||||
- ``SANIC_NO_UVLOOP=true SANIC_NO_UJSON=true python -m pip install sanic``
|
- ``SANIC_NO_UVLOOP=true SANIC_NO_UJSON=true pip install sanic``
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
|
|
|
@ -172,7 +172,7 @@ takes the format `<blueprint_name>.<handler_name>`. For example:
|
||||||
```python
|
```python
|
||||||
@blueprint_v1.route('/')
|
@blueprint_v1.route('/')
|
||||||
async def root(request):
|
async def root(request):
|
||||||
url = app.url_for('v1.post_handler', post_id=5) # --> '/v1/post/5'
|
url = request.app.url_for('v1.post_handler', post_id=5) # --> '/v1/post/5'
|
||||||
return redirect(url)
|
return redirect(url)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ Middleware are functions which are executed before or after requests to the
|
||||||
server. They can be used to modify the *request to* or *response from*
|
server. They can be used to modify the *request to* or *response from*
|
||||||
user-defined handler functions.
|
user-defined handler functions.
|
||||||
|
|
||||||
Additionally, Sanic providers listeners which allow you to run code at various points of your application's lifecycle.
|
Additionally, Sanic provides listeners which allow you to run code at various points of your application's lifecycle.
|
||||||
|
|
||||||
## Middleware
|
## Middleware
|
||||||
|
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -17,7 +17,9 @@ deps =
|
||||||
beautifulsoup4
|
beautifulsoup4
|
||||||
gunicorn
|
gunicorn
|
||||||
commands =
|
commands =
|
||||||
pytest tests --cov sanic --cov-report term-missing {posargs}
|
pytest tests --cov sanic --cov-report= {posargs}
|
||||||
|
- coverage combine --append
|
||||||
|
coverage report -m
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
deps =
|
deps =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user