Ive tried to look up how to accept texts from mobile phones with Django (e.g. like Twitter) to post data to user accounts. All i have ran across is how to make a mobile web app with django as in different layouts etc.. Has anyone any idea where a tutorial on this might 开发者_开发问答be or how in the world to start doing this with django? Thanks!
There are two ways to achieve what you want:
Home-grown solution
Attach a mobile phone to a PC and periodically read incoming SMS from the phone. Probably the easiest way to accomplish this is with gammu, specifically gammu-smsd-mysql. It writes incoming SMS to a MySQL database. Just make sure the phone you use is supported by gammu.
You can easily connect to this database from Django, see Integrating Django with a legacy database.
I used this approach for a while and it worked reliably, although on a very small scale. If you plan to build a real service that receives thousands of SMS, the home-grown solution is not for you.
Professional solution
Find a service provider that offers an SMS gateway. There are countless providers, the first name that comes to my mind is Twilio.
There is a django based SMS application framework called RapidSMS. I am using it for a project at the moment, and it works fine. Here is the link
http://www.rapidsms.org/
First of all you either need to setup your own gateway with a mobile phone and a software that reads incoming text and processes it or find a service provider. If you buy a short code it may be costly but there should be some services around that allows you to use common number with a keyword to receive and process incoming txts.
精彩评论