DEV Community

loading...

How to install Django on Windows machine

gregruminski profile image Greg Ruminski ・1 min read

The easiest way to install Django on a Windows machine (fully Windows installation, not using WSL) is to use the scoop package manager (https://github.com/lukesampson/scoop).
Scoop is VERY useful when developing on Windows, it has a huge library of packages, I highly recommend trying it out.


Install Python

scoop install python

check if python installed correctly

python --version

Pip

pip is a package manager for Python (https://pip.pypa.io/en/stable/)
(note: scoop python installation installs pip by default)

Install virtualenv and virtualenvwrapper

virtualenv and virtualenvwrapper (https://virtualenv.pypa.io/en/stable/) provide a dedicated environment for each Python (and therefore Django) project you create.

It is not mandatory, but is very useful and will save you time in the future.

pip install virtualenvwrapper-win

Create a virtual environment for your project:

mkvirtualenv myproject

The virtual environment will be activated automatically and you’ll see “(myproject)” next to the command prompt to designate that. If you start a new command prompt, you’ll need to activate the environment again using:

workon myproject

Install Django

Django can be installed easily using pip within your virtual environment.

In the command prompt, ensure your virtual environment is active (workon myproject), and execute the following command

pip install django

This will download and install the latest Django release.

Verify your Django installation by executing

django-admin --version

Discussion (0)

pic
Editor guide