Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
8.61k
stars
581
forks
source link
RuntimeError: Request.Response can only be called once per request #132
Open
vadim-shadrin opened 6 years ago
from japronto import Application
def donotwork(request): access = 1 if isAllow(access,request): return request.Response(text='Hello world!')
def work(request): access = 1
def denied(request): return request.Response(text='denied!')
def allowed(request): return request.Response(text='allowed!')
def notauth(request): return request.Response(text='not auth!')
def isAllow(access,request):
app = Application() app.router.add_route('/donotwork', donotwork) app.router.add_route('/work', work) app.router.add_route('/allowed', allowed) app.router.add_route('/denied', denied) app.router.add_route('/notauth', notauth) app.router.add_route('/work', work) app.run(debug=True)