07 March 2014

Starting with Django in Ubuntu - Installation

2 comments

Installing django in UbuntuHi Guys, Today we are going to setup our Ubuntu system for Django Development, as you all know that Django is a free and open source web application framework, written in Python, which follows the model–view–controller architectural pattern. Django's installation is somewhat tricky for beginners as it required many things to take care of. Don't worry, In this post I will cover each and every thing that required for Django installation and I will guide you, how to set up your first project in Django . So lets get started.


How to Install Django in Ubuntu


Step 1. Install pip : pip is a package management system used to install and manage software packages written in Python. It is prefered over easyinstall in python. You can read more about pip from Here.

$ sudo apt-get install python-pip

Step 2. Install virtualenv using pip : virtualenv is a tool to create isolated Python environments. You can read more about virtualenv from Here.

$ pip install virtualenv

Step 3. Install virtualenvwrapper using pip : virtualenvwrappers is used for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies. Read more about virtualenvwrapper from Here

$ pip install virtualenvwrapper

Step 4. Go to Home folder using following command and create django folder.

$ cd && mkdir django

Step 5. Create virtual python environment in this folder.

$ cd django
$ virtualenv --no-site-package django_test

Note: Above command create django_test virtual environment in django folder.

Step 6. Activate your virtual environment using following command

$ source django_test/bin/activate


Note: If you are seeing prompt like this in your terminal, then you are going good.

Step 7. Install Django

(django_test)$ pip install django

Step 8. Create first django project

(django_test)$ cd django_test
(django_test)$ django-admin.py startproject django_project

Step 9. Start your project

(django_test)$ cd django_project
(django_test)$python manage.py runserver
Validating models...

0 errors found
March 08, 2014 - 05:14:37
Django version 1.6.2, using settings 'django_project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Note: copy & paste http://127.0.0.1:8000/ in your browser and you will see the following page


Step 10. Deactivate your virtual python environment using following command

(django_test)$ deactivate
$

Hurray! We have successfully setup and run our first django project. In next part we will see the use of virtualenvwrapper and setup our first app. Hope fully you have enjoyed post.

Have a nice day and Enjoy :)


If You Liked This Post Please Take a Time To Share This Post

You May Also Like...

2 comments:

  1. Because of posts like this I surf the internet and when I found you, the time I felt I was wasting, just turned my thoughts around and now I am thinking I invested my time in something really interesting.

    ReplyDelete
  2. Really, these quotes are the holistic approach towards mindfulness. In fact, all of your posts are. Proudly saying I’m getting fruitfulness out of it what you write and share. Thank you so much to both of you.
    J2EE Training in Chennai
    JAVA Training in Chennai
    Linux Training in Chennai

    ReplyDelete