擅长:python、mysql、java
<p>您没有设置根路径。在</p>
<p>或者你打开<a href="http://127.0.0.1:5000/send" rel="nofollow noreferrer">http://127.0.0.1:5000/send</a></p>
<p>或者,您可以使用这个快速而肮脏的修复程序(正如您在decorators中看到的,现在/和/send都被考虑在内):</p>
<pre><code>from flask import Flask, render_template,request
app = Flask(__name__)
@app.route('/',methods = ['GET'])
@app.route('/send',methods = ['GET','POST'])
def send():
if request.method == 'POST':
age = request.form['age']
return render_template('age.html',age=age)
return render_template('index.html')
if __name__ == '__main__':
app.run()
</code></pre>
<p>如果不处理'/'路由,则打开<a href="http://127.0.0.1" rel="nofollow noreferrer">http://127.0.0.1</a>时不会发生任何事情</p>
<p>如果你能更清楚地解释你想要得到什么样的结果,我会帮得更好。在</p>