Thursday, July 17, 2014

django - Installing django

Once you have successfully installed Python, you are now ready to install django.

django is a Python package and for installing packages like these, you must first need a tool called 'Setuptools'.  So the following steps are required:

  • Download and install 'Setuptools'
  • Download and install 'pip' (it is a package manager to install Python packages)
  • Download and install django
Installing Setuptools:

There are couple of ways to install this.  But I find the following approach simpler and straight forward:

Download the 'ez_setup.py' file by clicking this link and save the file in any folder, say 'C:\Python27'.

Then go to DOS prompt and to this folder ('C:\Python27').  At the command prompt, type 

python ez_setup.py

The script in 'ez_setup.py' will automatically download and install Setuptools as shown in the following screen:



If the installation is successfully completed, you will see the command prompt again.

Installing pip:

Once 'Setuptools' is installed, 'pip' can be installed by entering the following command at the DOS prompt:

easy_intall pip

 

This will easily install 'pip'.

Installing django:

Now, django can easily be installed by entering the following command:

pip install django

This will download the package, extracts its contents and installs it as shown in the below screen:

 


The command prompt is displayed after it is installed successfully.  o confirm that, enter the following at DOS prompt:

django-admin.py version

It will return the version of django framework.

Congratulations again!!!  You have successfully installed django framework in your computer.  Now we can move on to writing web applications.

No comments:

Post a Comment