This tutorial will not only help you answer the how to
install django on windows 10 question but also help you install django if you
have Windows 7, Windows 8 or Windows 8.1.
You can follow the same steps for all the windows versions
mentioned above.
Step 1:
Download python.
A] Go to www.python.org
Step 2:
Once the file is downloaded start the setup.
Make sure to check the "Add Python 3.6 to PATH" or
"Add Python 2.7 to PATH" depending on your OS.
Click on the "Customize Installation" part and
check whether all the options are ticked.
Do not uncheck or deselect any of the options that have been
ticked.
Click on "Back".
Then click on Install Now.
The wizard will show the progress of the setup.
After it's installed click on "Close".
Step 3:
Go to start and search for "Windows Powershell".
Right-click on it and select the "Run as
administrator" option.
Step 4:
Here's how we will install Django using pip. You can refer
the GIF or follow the commands.
The GIF will show you how to install django on windows step
by step from here onwards.
Before beginning you have to open the Windows Powershell. Go
to "Start" or the Metro menu and then search for Windows Powershell.
When you find it. Right-click on it and "Run it as
administrator".
1] After opening the Windows powershell, we need to install
virtualenvwrapper.
It is used for creating isolated environments.
You can create an isolated
environment for each new Django project.
install pip windows
pip install
virtualenvwrapper-win
2] Now, we'll create a virtual environment for a project
mkvirtualenv
mywebsite
3] To activate the environment mywebsite we have to run the
following command.
workon
mywebsite
4] Next, we are going to install Django with the pip command
pip install
django
5] You can check the django version by executing the
following command.
python -m
django --version
6] We'll set the current directory to C drive.
cd \
7] The next step is to create a new directory to store the
new project that we are going to work on. In this case it will be webdesign.
mkdir newdir
Once you create the directory, set it as the current
directory.
cd newdir
8] Now, we need to startproject with
the django-admin startproject projectname where we will replace the projectname with a name of
the project.
As I have mentioned already it this case it will be
webdesign.
django-admin
startproject webdesign
9] Set the current directory to the project directory i.e
webdesign.
cd webdesign
10] After that is done simply run the
python
manage.py runserver
Now that we have completed the
installation you might have this question,
how to check if django is installed on windows?
Execute the following command and it will return the version
of your django install.