Building and running First Django Application on Ubuntu 13.04 – Part 1

Django is a popular web development framework based on Python. You can read more about here.

In this first part we will do basic setup required for Django on Ubuntu 13.04. Python comes already installed in all versions of Ubuntu. This tutorial will work for Python versions 2.6 or later and may not work for 3.0+ .

To Check python version type following in terminal

Python --version

We will need pip, a tool for installing and managing Python packages. Which can be installed using this command in terminal.

sudo apt-get install python-pip

Now we will install django framework

sudo pip install django

We will also need MySQL on our system for database requirments. So go ahead and follow this link to install MySQL and PHPmyAdmin(web client for MySQL database).

Vitualenv:
Generally you should do python based development in Virtualenv, you can read more about on this tutorial
http://warpedtimes.wordpress.com/2012/09/23/a-tutorial-on-virtualenv-to-isolate-python-installations/

We will use following tools to write and execute the python codes

1. IPython : Interactive python shell unlike boring IDLE(shell which comes with standad python)
run following commands in python

Sudo apt-get install ipython && ipython-qtconsole

you can type ipython directly in console or use ipython-qtconsole – the Qt frontend.

2. Sublime-Text : Very lightweight Text-editor cum IDE. We will use sublime text for coding most of the code.
Follo instruction on this tutorial to install sublime-text on ubuntu.

Now the setup is complete. Follow Part-2 to write your first django Application.

Some Helpful Links:
https://docs.djangoproject.com/en/dev/intro/tutorial01/
http://warpedtimes.wordpress.com/2012/09/23/a-tutorial-on-virtualenv-to-isolate-python-installations/
http://gettingstartedwithdjango.com/
http://learnpythonthehardway.org/book/