python - Flask request.form not retrieving any data -
i'm posting data following flask view using html form. reason, server never created. i've confirmed create_server
method works interpreter. form i'm using log in works. why isn't working?
@app.route('/add-server/', methods=['get', 'post']) def add_server_view(): if request.method == 'post': server_name = request.form['server_name'] create_server(server_name) return redirect(url_for('index') return render_template('add_server.html')
<form method=post> <input name=server_name> </form>
request.method
in caps , comparison case sensitive.
if request.method == 'post':
this code in werkzueg forces method name uppercase consistency.
Comments
Post a Comment