Twilio的新手問題:試圖在Heroku上運行使用Twilio API Python應用程序時
我創建的使用Twilio API,因爲我跟着教程之後General Assembly的應用我加
的文件是
- app.py
- Procfile
- requirements.txt
app.py
from flask import Flask
from flask import request
from twilio import twiml
import os
app = Flask(__name__)
@app.route('/caller', methods=['POST'])
def caller():
response = twiml.Response()
response.enqueue("Christmas Queue")
return str(response)
if __name__ == "__main__":
port = int(os.environ.get('PORT', 5000))
app.debug = True
app.run=(host='0.0.0.0'. port=port)
Procfile
web: python app.py
requirements.txt
flask>=0.9
twilio>=3.1
我將應用程序部署到了Heroku。然後我添加了URL到Twilio
我打電話來測試它,但得到了一個錯誤。不知道我的下一步可以進一步解決這個問題。
你的Python腳本有很多的語法錯誤。這是你的實際代碼嗎? – Blender 2013-05-06 23:58:29
@Blender我犯了很多錯誤,因爲我在低分辨率屏幕上觀看視頻,而且我以前沒有使用Python的經驗(所以我不知道語法錯誤)。現在我上面的內容反映了來自Twilio的人在課堂上教授的內容。但我很欣賞任何腳本更正/建議。 – JGallardo 2013-05-07 00:09:15