我遵循了http://docs.rapidsms.org/en/develop/tutorial/tutorial04.html中详细介绍的所有步骤,在Django的RapidSMS中使用tropo发送和接收短信,并将其部署在heroku上。然后我试着做了两件事。
1)使用tropo发送短信-我注册了一个电话号码,在选择后端时,我认为Tropo (my-tropo-backend)应该是后端选择中的一个选项。但我不认为tropo是一个后端选项,只是message_tester。
2)使用tropo接收短信-我向我的tropo手机号码发送短信,我可以在tropo日志中看到消息,但我在tropo日志中看不到来自Django URL https://yourhost.example.com/tropo/的响应(使用乒乓示例)。
我对RapidSMS和Tropo的Django设置如下:
INSTALLED_BACKENDS = {
"my-tropo-backend": {
"ENGINE": "rtropo.outgoing.TropoBackend",
'config': {
# Your Tropo application's outbound token for messaging (required)
'messaging_token': '244e51db5424c3438f122753b8947dee70803dshlfhdfdsdkjfdfd455466565e8e620c05f75323c17864',
# Your Tropo application's voice/messaging phone number, starting
# with "+" and the country code (required)
'number': '+1-000-200-6007',
},
},
"message_tester": {
"ENGINE": "rapidsms.backends.database.DatabaseBackend",
},
}urls.py有
url(r"^tropo/$",
views.message_received,
kwargs={'backend_name': 'my-tropo-backend'},
name='tropo'),并且'rtropo‘已经添加到INSTALLED_APPS中
我错过了什么,有没有人以前做过这件事,也遇到过这个问题?请让我知道。
谢谢。
发布于 2013-11-27 17:22:02
问题是我没有在Tropo设置中把尾部的斜杠放在URL的末尾。示例:我给了https://yourhost.example.com/tropo它应该是https://yourhost.example.com/tropo/
由于尾部有斜杠,Django在添加尾部斜杠后重定向到相同的URL,这一次数据是通过GET而不是POST发送的。
https://stackoverflow.com/questions/19713844
复制相似问题