fix blueprints documentation
This commit is contained in:
parent
feb1f1d71a
commit
f8c50b7f1e
|
@ -153,8 +153,8 @@ from sanic import Sanic
|
||||||
from blueprints import blueprint_v1, blueprint_v2
|
from blueprints import blueprint_v1, blueprint_v2
|
||||||
|
|
||||||
app = Sanic(__name__)
|
app = Sanic(__name__)
|
||||||
app.blueprint(blueprint_v1)
|
app.blueprint(blueprint_v1, url_prefix='/v1')
|
||||||
app.blueprint(blueprint_v2)
|
app.blueprint(blueprint_v2, url_prefix='/v2')
|
||||||
|
|
||||||
app.run(host='0.0.0.0', port=8000, debug=True)
|
app.run(host='0.0.0.0', port=8000, debug=True)
|
||||||
```
|
```
|
||||||
|
@ -168,6 +168,7 @@ takes the format `<blueprint_name>.<handler_name>`. For example:
|
||||||
@blueprint_v1.route('/')
|
@blueprint_v1.route('/')
|
||||||
async def root(request):
|
async def root(request):
|
||||||
url = app.url_for('v1.post_handler', post_id=5)
|
url = app.url_for('v1.post_handler', post_id=5)
|
||||||
|
# url = '/v1/post/5'
|
||||||
return redirect(url)
|
return redirect(url)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user