- Views: 1
- Report Article
- Articles
- Computers
- Programming
How to Install Django on Windows: Step by Step Full Guide
Posted: May 29, 2020
Hello World,
We are going to install the Django Framework on windows operating system today, Django is one of the most popular web frameworks in python. It is secure, advanced allows developers to rapidly develop their projects and meet deadlines. Its free and open-source software, it works both on Windows and Linux system.
In this tutorial, we are going to learn how we can install Django on Windows Operating System.
Install PythonBefore you install Django, you must make sure that you have python install. You can check whether it is installed on your Pc. if you don’t know-how to install python follow these steps
Step 1: Download the Python 3 Installer- Open a browser window and navigate to the Download page for Windows at python.org.
- Underneath the heading at the top that says Python Releases for Windows, click on the link for the Latest Python 3 Release – Python 3.x.x. (As of this writing, the latest in Python 3.6.5.)
Once you have chosen and downloaded an installer, simply run it by double-clicking on the downloaded file. A dialog should appear that looks something like this
Install Django on Windows O.S
The Commands that will run in this tutorial will work on Windows CMD Command Prompt and Windows Powershell.I will use Powershell but you can
use CMD if you want to prefer that.
Step 1: Open PowershellYou can search PowerShell in the Windows search box or you can open the Run dialog box by holding Windows Logo Key and R(Win+R) and type their PowerShell and click ok.
You should now have a PowerShell window opened.
Now you have successfully open PowerShell, let’s verify that you have installed python installed or not
Step 1: Confirmation of Python InstallationType python -V on the prompt to confirm that python has been successfully installed. Or you can check through Start Menu> Search Bar> Python 3.8.2
Step 3: Upgrade pipPython now comes with pip by default. But it is always is good practice to upgrade python-pip before working on any python Django project for the latest version.
Step 4: Create a Project DirectoryNow you need to create a project directory which will be named as django_Getintoic as you know this tutorial as the demo but in the real world, the project directory name would be Blog, forum, etc.
To create the directory:
mkdir django_GetintoicNow change into the django_Getinoic directory:
cd django_GetintoicYour Prompt should now show you that you are in the "django_Getintoic" directory like below:
Step 5: Create a Virtual EnvironmentThe virtual environment is an essential python environment where you can install packages and python essential dependencies without affecting other python projects running inside.
To create a virtual environment, type python -m venv and wait for few seconds:
python -m venv venvit will create a directory called venv in the project directory
Next, we will activate the virtual environment.
Step 6: Activate Virtual EnvironmentRun the following command to activate the virtualenv
venv\scripts\activateWhen virtualenv is activated, you will see a (venv) at the beginning of the prompt.
(Venv) PS C:\\Users\Faraz\django_Getintoic> (Venv)> pip Install Django (Venv)> pip Install Django PS C:\Users\Usernamedjango_Getintoic> hon -m pip install --upgrade pipAbout the Author
A Web Developer & Cyber Security Expert www.getintoic.com
Rate this Article
Leave a Comment