访问url


你可以通过 args 属性来访问 URL 中提交的参数 ( ?key=value ):

searchword = request.args.get('q', '')


  1. from flask import render_template
  2. @app.route('/hello/')
  3. @app.route('/hello/<name>')
  4. def hello(name=None):
  5. return render_template('hello.html', name=name)
request.form['username']
redirect(url_for('login'))

访问的是方法




原文地址:https://www.cnblogs.com/wuqingzangyue/p/5749943.html