Installing Django on Windows

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).
  2. Install pip (used to install python packages).
  3. Install virtualenv.
    • In the command prompt, run:
      pip install virtualenv
    • If the error "pip command not found" occurs, check that the python script directory is in your $PATH environment variable. Typical script directory for Python 2.7 is C:\Python27\Scripts
  4. Setup your virtual environment.
    • In the command prompt, run virtualenv my_env  . Replace my_env with the folder where you want the virtual environment files to be generated
    • Then, run my_env\Scripts\activate.bat to activate your virtual environment.
  5. Install Django.
    • 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.
    • In the command prompt, run:
      pip install django
      
    • You have completed your Django installation on a virtual environment for your project. You can now continue to develop using Django!