Using Django with Virtualenv and PIP

Recently, I have switched over to using Virtualenv and PIP for all my python devolopment, and I am totally convinced that is the way to go. I will not get into why we should use those, instead will outline how to set this up with Django for development as well as deployment.

 

1. Install Basic Tools like Git, PhpMyadmin, MySQL, Mercurial etc

 apt-get install curl sox mysql-server mysql-client libmysqlclient16-dev git-core apache2 libexpat1 ssl-cert unixodbc-dev libmyodbc phpmyadmin mercurial 

Read the rest of this post »

My new editor - Geany

I have been using the default text editor in Ubuntu, Gedit, and have modified it to work it like an IDE. It worked good, but still lacked a lot of features which a good IDE would have (like code folding, symbols browser etc). Lately, I saw a blog post with a mention of few new IDEs around which are as light wieght as G-Edit. That is when i first heard of Geany.

Geany is a lightweight but surprisingly powerful GTK-based IDE. I am totaly sold over it and it has become my default IDE in just 2 hours of playing around. Works beautifully with Python, Django, HTML, JS, CSS and FreeSWITCH C source files. Thats all i need for my coding. But Im sure it plays well with other languages too. It has advanced features of an IDE and remains very light weight.

Read the rest of this post »

Why Phone number verification services will fail in India?

Update: I have been pondering over some posible solution for this, and the primary reason for concern for me here was how would businesses verify phone numbers authentically in India considering both approaches look flawed. After some basic hacking and testing at my end, I have a probable solution which seems to be working for India.

Current Flaw in Approach 2 (Similiar to ZipDial):

Currently, the Caller ID can easily be spoofed to the Regular phone numbers (080349xxxx) like the ones used by ZipDial, using any VoIP service, and it is very difficult for the system to detect the spoofed ID. However the caller id cannot be spoofed through a regular phone connection from within India.

This, got me thinking, if there could be a way to block VoIP services from reaching the numbers, then Approach 2 could very well get the job done.

Read the rest of this post »

Setup Mercurial GUI Client on Ubuntu 10.10

Recently Bitbucket  introduced new plans, which allows unlimited private repositories for startups (Less than 5 contributors). This works really well for me, when I decide to use a dvcs and want to avoid the Github paid plans for private repo hosting.

 

Command line is nice, but somehow, I still prefer a GUI client to see my diffs, as its more productive for me. So Lets get started..

(All the commands are for the terminal/shell)

Read the rest of this post »

Replace OpenJDK with Oracle-SunJDK on Ubuntu 10.10

By default Ubuntu 10.10 (32-bit) installs OpenJDK for JRE, JDK. Since OpenJDK tries to replace the properietry pieces of Sun-JDK, this is a nice project, however, there is still time before it grasps all the specs and works flawlessly.

Before we begin, type: java -version, at the command prompt, and you will see that the version is a Open-JDK version.

 

To Replace Sun-JDK with Open-JDK follow the setps below:

Read the rest of this post »

Using Google Text to Speech with FreeSWITCH

Google Translate can be used as a  text-to-speech converter, providing a handy MP3 file of your chosen words. It's not an official offering, but Google Translate provides you the spoken version of your translation. There’s no official API for the text-to-speech service yet, but people around the web have figured out a way on using it.

One can get the speech audio as an MP3 file via a simple HTTP GET (REST) request:

Read the rest of this post »

Install Python2.6.4, mod_wsgi and Django on CentOS 5.4

Once I got Django running on windows, I started hacking around setting Django up on CentOS. Little did I know, that upgrading Python and getting Django wouldn't be that easy. CentOS 5.4 uses python 2.4, and replacing it is not really an option since yum and other core packages depend on it.

The solution was to install 2.6.4 from source and use /opt for the prefix  so that 2.6.4 becomes the default python. Then move on to install mod_wsgi, setup Apache to use mod_wsgi and Install Django on CentOS 5.4

Read the rest of this post »

Setup Django on Windows with Apache and MySQL in 15 mins

Django is an open source web application development framework, for python. I am totally impressed with it as it allows rapid application development and provides a brilliant auto generated administrative interface for the web app. Setting up Django on Windows without Apache & Mysql is fairly out of the box, but doing that in production is not recommended. Hence I tried to use existing portable and ready made stacks for Django on windows. Having tried them I would say, I wasted around 6 hours trying to get everything working.

Bottom line: I decided to install Django on windows on my own using WAMP + mod_wsgi + mysql_python to run Django on windows. Lets see how:

Read the rest of this post »