python flask log 1
做了Day 1 -3, 都真係好方便.
- 安置 flask
pip install flask- new app.py
from flask import Flask,render_template,url_for,redirect
app=Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/second')
def test():
return render_template('test.html')
@app.route('/third')
def testThird():
return redirect(url_for('index'))
if __name__ == '__main__':
app.run(host='0.0.0.0',port='5000',debug=True)
render_template 會認 templates.
留言
張貼留言