BACK TO ARTICLES

How to Install Python and Django on Windows machine? Step-By-Step with Screenshots

Published on August 24, 2020

Fakhar ul Hassan

Infrastructure Consultant, Cloud Architect & Automation, DevOps, Infrastructure as Code (IaC), Ansible, Terraform

How to Install Python and Django on Windows machine? Step-By-Step with Screenshots

The famous web framework for Python is Django, which helps the programmers with rapid development capability and clean practical design. It has standard components available to enable developers to create/build complex websites in a fast and easy way.

For the beginners, I am attaching here the Step-By-Step guide, as how to install/configure Python 3.7 and Django 2.2 on windows machine. In my next guide, I shall try to show, how to develop a simple website very easily and quickly using Python Django web framework.

Step-1:        First download python 3.X:

Download Link: https://www.python.org/downloads/release/python-373/

No alt text provided for this image
No alt text provided for this image

Step-2:        Double click the downloaded file (i.e. pthon-3.7.3.exe in this case) and click “Install Now” and select the “Add Python 3.7 to Path” checkbox.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Step-3: Check if python is successfully installed: “python –version”,

No alt text provided for this image

Step-4: Check if pip is successfully installed: “pip –version”

No alt text provided for this image

Step-5: Install Virtual Environment using command: ”pip install virtualenvwrapper-win”

No alt text provided for this image

Step-6: Make virtual environment using command: “mkvirtualenv mywebsite1”

No alt text provided for this image

Step-7: Activate your new virtual environment using command: “workon mywebsite1”

No alt text provided for this image

Step-8: Install Django using pip command: “pip install django”

No alt text provided for this image

Step-9: To check, as if the django version is successfully installed:

“python –m django –version”

No alt text provided for this image

Step-10: Create project directory: “mkdir myprojects” and then “cd myprojects”

No alt text provided for this image
No alt text provided for this image

Step-11: Start project, using command: “django-admin startproject mywebsiteproject” and then “cd mywebsiteproject”

No alt text provided for this image
No alt text provided for this image

Step-12: Run the python server: “python manage.py runserver”

No alt text provided for this image

Step-13: To check, type “http://127.0.0.1:8000” in the browser and following screen will show:

No alt text provided for this image

================

Written by

Fakhar ul Hassan

Infrastructure Consultant, Cloud Architect & Automation, DevOps, Infrastructure as Code (IaC), Ansible, Terraform