Django is a Python web framework which allows rapid development of website by following the Model-View-Controller architecture.

To install Django, definitely you need to have python installed first. If you haven’t, download it from the official website here.

After python is installed, the recommended way of installing django is to use virtualenv to manage the django installation. Therefore, you need to have virtualenv installed first. Here goes for the steps:

  1. Install setuptools (required by pip).

    1. Download Windows installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools
    2. Run the installer to install setuptools.
  2. Install pip (used to install python packages).

    1. Download Windows installer from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
    2. Run the installer to install pip.
  3. Install virtualenv.

    1. In the command prompt, run:

      pip install virtualenv
      
    2. If the error “pip command not found” occurs, check that the python script directory is in your $PATH environment variable. The typical script directory for Python 2.7 is C:\Python27\Scripts.

  4. Setup your virtual environment.

    1. In the command prompt, run virtualenv my_env . Replace my_env with the folder where you want the virtual environment files to be generated
    2. Then, run my_env\Scripts\activate.bat to activate your virtual environment.
  5. Install Django.

    1. Now, you are in your virtual environement, and you will see a ’(my_env)’ prefix on your command prompt. If you couldn’t find the prefix, check that you have executed the previous step correctly and you are using the same command prompt.
    2. In the command prompt, run:

      pip install django
      
    3. You have completed your Django installation on a virtual environment for your project. You can now continue to develop using Django!