上面的代碼在我的燒瓶應用程序中拋出錯誤。燒瓶 - 重定向url_for錯誤
@@app.route('/')
.....
return redirect(url_for('nextPage'),id=DBTable.id)
@app.route('/<path:id>')
@login_required
def nextPage(id):
return render_template('page2.html')
Error -
---------------------------------------------------------------------------
File "C:\Python27\lib\site-packages\werkzeug\routing.py", line 1607, in build
raise BuildError(endpoint, values, method)
BuildError: ('nextPage', {}, None)
<SocketIOServer fileno=116 address=0.0.0.0:5000>: Failed to handle request:
request = POST /landingPage HTTP/1.1 from ('127.0.0.1', 50287)
application = <flask.app.Flask object at 0x0000000002643B70>
請幫我與上面的問題
嘗試添加「/」在路線的終點爲@ app.route('/ /') –
rajpy
2013-08-28 07:48:54