Sunday 21 August 2016

Hardware Approach vs API: Choosing the best and right SMS API gateway in Pakistan



Recently I got a chance to work in a project, in which there was a requirement to integrate the two way messaging mechanism in web system. So the very first thing that came to my mind was which sms messaging method to go for? There are the choices for hardware approach and the API approach. Hardware approach is that in which usually modems are used as a communication medium is very popular for many organisations that are been using this sms mechanism in their systems for now long time. There is a relative easiest way to achieved similar thing is using the cloud based API services. In this gateway providers rather than to setup hardware on client system provide cloud based APIs to be integrated with the clients systems. For me this API based approach is more suitable, so I opted it over hardware approach.

The second thing on which I have to made decision was, which SMS API gateway to choose? There are plenty of such gateway providers in the web, choosing your best and right option is really a hectic job, at least it was for me. I have different conditions from the customer of my system related to pricing, time, durable etc. , to whom I have to address. So I prepared a comparison table that helped to select my best and right SMS API gateway. The system on which I was working was for Pakistan so my primary concern of work is only for Pakistani audience, but you can also get good sort of knowledge for any region.

Solution/PlatformCoverageLocal Number2 wayAPIEase of integrationpricing
TwilioyesnoyesyesyesLow
ClickatellyesnoyesyesnoAverage
plivo*noyesyesyeslow
Sinch*noyesyesyesAverage / very low ⁰¹
smsglobal*noyesyesyesAverage ⁰¹
nexmo-noyesyesyesAverage
Hardware ApproachyesyesyesnonoHigh

* Need Credentials to test / Not Free / Failed to test
⁰¹ Depending on the scale of use





Saturday 13 August 2016

How to reset all migrations in django > 1.7 in windows and linux?

Django has a awesome way to handle changes in the database, which help us to track the structure of the database and keep us safe from manual interactions with the database. Databases changes are mapped according to the model definitions. If you worked in other python frameworks like Odoo or web2py then you can definitely realize what a great thing it is. Here is how they are defining these migrations:
Migrations are Django’s way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema
But often times this facility becomes tension and we stuck in such a situation where it fails to caters our need and the only way we have is to reset all the migrations and start the migration from the initial. For such a situation in Windows and Linux these may can help you.

For Windows:

del project_dir/app_dir/migrations/*
echo.>project_dir/app_dir/migrations/__init__.py
python manage.py makemigrations
python manage.py migrate



For Linux :

$/home/project-dir@user: find . -path *migrations* -name "*.py" -not -path "*__init__*"
python manage.py makemigrations
python manage.py migrate


ref: http://stackoverflow.com/a/30016412/3832653