Implement SMS gateway on django project - python

I know some SMS API, they are too expensive for the goal of my application.
Is there a way to create an SMS server to alert users, then the user can send feedbacks, my application will easily reply based on some key codes. I heard about Rapid SMS. What comes to my mind:
A modem
SIM card
A daemon software (kannel maybe)
Web application with django
Any help will be gracefull!

Twilio supports sending SMS messages, and I believe it can also carry out certain actions on receiving an SMS. It has a Python API client so it should in principle be practical to integrate it with your application.

Related

How to send push notifications to iOS using a python api

I have create a webscraper that sends notifications to my phone whenever certain events are detected. So far I have achieved this by sending emails through the sendgrid api. Its a pretty nice service, and it is free, but it clutters up the mailbox quite a bit.
In stead I’d like to send messages directly to the iOS notification bar. Does anyone here has experience with sending push-notifications to iOS and can point me in the correct direction? I would be happy with a subscription service, but would off course prefer a solution that does not require a third party if it is possible.
I have tested PushNotifier, but I found it a bit clunky, and the notifications are neither customisable or beautiful. Its also not a free service, which would have been a great plus.
Maybe you should check out pushover.net. They have a simple WebAPI to send customized notifications to iOS devices.
See https://support.pushover.net/i44-example-code-and-pushover-libraries#python for code samples.

sending Facebook messages with python script

i'm trying to find a way to send Facebook messages using a python scripts on my computer (e.g. something like send_msg(user_id, msg)). I figured the Facebook API would make this process easy but i was wrong (i don't have much experience with APIs). It seems the only way to automate sending messages is to host the script (flask app) on some server (e.g. Heroku) where Facebook will communicate exclusively with it and bypass my computer all together. I want to know if this really is the only way of communicating with the Facebook API.

The architecture of a real-time web chat app

I would to create a real-time web chat application using web.py in python. The problem is that I don't know how to 'architect' or design the such an app.
The way I'm thinking to implement this app is the following:
a user logs into the app.
the app connects to a controller that has a push service to push new messages and a queue service to store the new messages.
when the user sends a message, the app sends the message with an ajax call to the controller and the controller stores the message in a queue.
then the controller sends the messages in the queue to the destination user by its push service.
However I see this is a very poor design since I see a lot of ajax requests being sent here. I really don't know if there are better designs or architectures for such a service. So can you please point me toward the correct design for a real-time chat app?
Alex,
This is an understandable question, I recently thought about it when I was building my own messaging application. This is the way I broke down the app's functionality:
User registration
User authentication
Adding a new friend by username
Approving a friend
Messaging with a friend in list (Of course)
Shows online and offline users
Runs a background service in order to get messages even when the application is closed.
Uses notification area when a new message is received.
Quiting the application(kills the background service)
A few things I realized after building this application was:
The back-end architecture was a simple mixture of a simple CRUD application with pub/sub functionality. You can read up more on pub/sub systems here. Here's a simple chat application built using Ruby on Rails. You can look at it for reference, it's very well architected.
You should think about the last steps listed in the above functionality as much in the beginning of this app as you do in the end. If you architect it well in the beginning, the final steps will just fall into place! :-)
If you want to learn about concurrency and do something really cool, I suggest trying to implement some of the frameworks discussed here.
Please let me know if you have any questions!

RESTful API across multiple users

I am somewhat new to RESTful APIs.
I'm trying to implement a python system that will control various tasks across multiple computers, with one computer acting as the controller.
I would like all these tasks to be divided amongst multiple users (ex. task foo runs as user foo, and task bar runs as user bar) while handling all requests with a central system. The central system should also act as a simple web server and be able to server basic pages for status purposes.
It it possible to have each user register a "page" with a central server for the API and have the server pass all requests to the programs (probably written in Python)?
Sure, you just need the clients to POST their notifications URL to the server, so that the server can then POST them back with the requests. These are called Webhooks by some people.
Also see RESTful Webhooks.
Yes. Keep in mind that being RESTful is merely a way to organize your web application's URL's in a standard way. You can build your web application to do whatever you want.

Subscription web/desktop app [PYTHON]

Firstly pardon me if i've yet again failed to title my question correctly.
I am required to build an app to manage magazine subscriptions. The client wants to enter subscriber data and then receive alerts at pre-set intervals such as when the subscription of a subscriber is about to expire and also the option to view all subscriber records at any time. Also needed is the facility to send an SMS/e-mail to particular subscribers reminding them for subscription renewal.
I am very familiar with python but this will be my first real project. I have decided to build it as a web app using django, allowing the admin user the ability to view/add/modify all records and others to subscribe. What options do I have for integrating an online payment service? Also how do I manage the SMS alert functionality? Any other pointers/suggestions would be welcome.
Thank You
Payment gateway integration:
Here is a detailed article about how to integrate the Authorize.net payment system into a Django project. Authorize.net is used by a few popular Django projects, including the Satchmo e-commerce store project.
django-paypal is a pluggable Django app which lets you connect to PayPal merchant services.
SMS alerts:
django-sms is a Django app which is "...designed to make sending SMS text messages as simple as sending an email." so might be a good start.
General Django
You didn't mention your knowledge level of Django itself; if you need to brush up on your Django skills I would highly recommend the book Django 1.0 Website Development.
I think it's also worth pointing out that the resources I've mentioned here were all found in the first few results of a Google search for each topic. These are the search terms I used:
django payment gateway integration
django paypal integration (because I knew of PayPal beforehand)
django sms alerts
I'd like to comment on the SMS alert part.
First, I have to admit that I'm not familiar with Django, but I assume it to be just like most other web frameworks: request based. This might be your first problem, as the alert service needs to run independently of requests. You could of course hack together something to externally trigger a request once a day... :-)
Now for the SMS part: much depends on how you plan to implement this. If you are going with an SMS provider, there are many to choose from that let you send SMS with a simple HTTP request. I wouldn't recommend the other approach, namely using a real cellphone or SMS modem and take care of the delivery yourself: it is way too cumbersome and you have to take into account a lot more issues: e.g. retry message transmission for handsets that are turned off or aren't able to receive SMS because their memory is full. Your friendly SMS provider will probably take care of this.

Categories