0
我是新來的燒瓶和twilio,我得到404錯誤運行我的應用程序(我正在按照本教程:https://www.twilio.com/blog/2012/01/making-an-sms-birthday-card-with-python-and-flask.html)。我GOOGLE了這個和搜索堆棧溢出,但我無法修復它。下面是我的代碼:404錯誤未找到
from flask import Flask
import os
app = Flask(__name__)
if __name__ == '__main__':
port = int(os.environ.get('PORT', 5000))
if port == 5000:
app.debug = True
app.run(host='0.0.0.0', port=port)
而且我得到這個錯誤: 404未找到
未找到
的請求的URL沒有在服務器上找到。如果您手動輸入網址,請檢查拼寫並重試。
我正在從終端我的應用程序轉到: 蟒蛇app.py
注意,在你的Python腳本的正文中添加這。也就是說,在if __name__ =='__main __''塊之前。 – Wilduck 2014-10-02 19:33:53
仍然收到404錯誤。這是我在我的終端中得到的:127.0.0.1 - - [02/Oct/2014 20:37:56]「GET/HTTP/1.1」404 - – 2014-10-02 19:38:45
你在瀏覽器地址欄中輸入什麼內容? – b10n 2014-10-02 19:43:35