debug 'Blueprint names must be unique'
This commit is contained in:
parent
0e4aaf8856
commit
a82145c4e6
|
@ -5,8 +5,8 @@ from sanic.response import json, text
|
||||||
|
|
||||||
app = Sanic(__name__)
|
app = Sanic(__name__)
|
||||||
blueprint = Blueprint('name', url_prefix='/my_blueprint')
|
blueprint = Blueprint('name', url_prefix='/my_blueprint')
|
||||||
blueprint2 = Blueprint('name', url_prefix='/my_blueprint2')
|
blueprint2 = Blueprint('name2', url_prefix='/my_blueprint2')
|
||||||
blueprint3 = Blueprint('name', url_prefix='/my_blueprint3')
|
blueprint3 = Blueprint('name3', url_prefix='/my_blueprint3')
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route('/foo')
|
@blueprint.route('/foo')
|
||||||
|
@ -18,6 +18,7 @@ async def foo(request):
|
||||||
async def foo2(request):
|
async def foo2(request):
|
||||||
return json({'msg': 'hi from blueprint2'})
|
return json({'msg': 'hi from blueprint2'})
|
||||||
|
|
||||||
|
|
||||||
@blueprint3.websocket('/foo')
|
@blueprint3.websocket('/foo')
|
||||||
async def foo3(request, ws):
|
async def foo3(request, ws):
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user