[問題] 關於 Flask 奇怪問題
python : 3.5
剛碰Flask, 抱歉有兩個問題想請問一下各位,
問題1
app = Flask(__name__)
def mailDemo():
mailDemo = MailDemo()
r = mailDemo.send_MailDemo()
return r
我改成以下就正常
def mailDemo():
mailDemo = MailDemo()
return mailDemo.send_MailDemo()
就會報 View function did not return a response錯誤
問題2, 當我輸入localhost/Redirect 想顯示 error.html, 用轉址的方式,
但我這樣寫一樣會出現View function did not return a response錯誤
@app.route('/Redirect')
def demoRedirect():
return redirect(url_for('Errorno'))
@app.route('/Errorno')
def errorno():
return render_template('error.html')
非常感謝 ~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.34.181.227
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1447429791.A.1E5.html
→
11/14 00:25, , 1F
11/14 00:25, 1F
→
11/14 00:26, , 2F
11/14 00:26, 2F
→
11/14 00:32, , 3F
11/14 00:32, 3F
→
11/14 00:34, , 4F
11/14 00:34, 4F
→
11/14 00:34, , 5F
11/14 00:34, 5F
→
11/14 00:37, , 6F
11/14 00:37, 6F
→
11/14 00:40, , 7F
11/14 00:40, 7F
Python 近期熱門文章
PTT數位生活區 即時熱門文章