I have searched a lot  for examples and tutorial of “Android device talking to Django Server”.I couldn’t find one.So i’m posting this example how an Android Device talks to Django Server. I’m going to use the following in my  example project

Server       : Django Server

Database  : MySQL

Android     : Eclipse Juno

  Today I’m going to do the basic setup of Django Server(Ubuntu).

1) Python is defaultly installed in Ubuntu,if it is not installed,please follow the below steps

cd ~/Downloads/
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz

//Extract and go into the directory

tar -xvf Python-2.7.3.tgz
cd Python-2.7.3

//Now, install using the command you

[sudo]make install

2) Install PIP

[sudo] apt-get install python-pip

I request you to setup Virtual Enivorment and use that for any Django Project

3)Install  and create Virtual Envinorment

[sudo] pip install virtualenv
//After installation create one virtual environment
root@root:~$ virtualenv loginproject-env

4) Install Django Now that we had created a virtual environment . I will log into that and install Django

root@root:~$source loginproject-env/bin/activate
(loginproject-env)root@root:~$pip install Django

5) Install MySQL  You can install MySQL out side the virtual environment

root@(loginproject-env)root@root: decativate
root@root:~$[sudo] apt-get install mysql-server

6) As we are using MySQL as database we have to install  the python-mysqldb , libmysqlclient-dev,python-dev,mysql-python tools.You can install this inside the virtual environment

root@root:~$ source loginproject-env/bin/activate
(loginproject-env)root@root:~$ apt-get install python-mysqldb
(loginproject-env)root@root:~$ apt-get install libmysqlclient-dev
(loginproject-env)root@root:~$ apt-get install python-dev
(loginproject-env)root@root:~$ pip install mysql-python

In the next post i’ll explain you how to start a new project and i will create the Django server which we can talk to Android Device.

Android Device Talking to Django Server Part 1
Tagged on: