How to Install Django in Python (Windows, Mac & Linux)

If you’ve been hearing about Django and want to start building web apps with Python, you’re in the right place. In this guide, I’ll walk you through how to install Django step-by-step — on Windows, Mac, or Linux — from scratch.

I’ll also show you how to run your first Django project, install a specific version, and fix the most common errors beginners run into.

By the end, you’ll have Django fully installed and a development server running on your machine in under 10 minutes.

Table of Contents:

What Is Django (And Why Should You Use It)?

Django is a free, open-source Python web framework that lets you build web applications fast. It’s what Instagram, Mozilla, and Pinterest were originally built on — so it’s battle-tested for large-scale apps.

Here’s why Django is worth learning in 2026:

  • Batteries included — It comes with authentication, an admin panel, ORM, URL routing, and templating right out of the box
  • Django 5.2 is the current LTS — Released in April 2025, it’s supported with security updates until at least April 2028
  • Huge community — Tons of packages, tutorials, and Stack Overflow answers to help when you get stuck
  • Fast to prototype — You can go from idea to working app in hours

What You Need Before Installing Django

Before we start, make sure you have the following:

  • Python 3.10 or higher — Django 5.2 officially supports Python 3.10, 3.11, 3.12, and 3.13
  • pip — Python’s package installer (comes bundled with Python 3.4+)
  • A terminal or command prompt — CMD, PowerShell, Terminal, or VS Code’s integrated terminal works fine

Not sure which Python version you have? Run this:

python --version

You can refer to the screenshot below to see the output.

install Django

Or on Mac/Linux:

python3 --version

If you see Python 3.10 or above, you’re good to go.

The Right Way to Install Django (Use a Virtual Environment)

Before I show you the commands, let me tell you about the single most common beginner mistake: installing Django globally.

If you install Django system-wide without a virtual environment, you’ll run into version conflicts when you start working on multiple projects. Project A might need Django 4.2, Project B needs Django 5.2 — without a virtual environment, you can’t have both.

A virtual environment is just an isolated folder that holds the Python packages for one specific project. It keeps everything clean and separate.

💡 My rule of thumb: Every Django project gets its own virtual environment, no exceptions.

How to Install Django on Windows 10/11 (With Virtual Environment)

Step 1 — Check if Python Is Installed

Open Command Prompt (search cmd in the Start menu) and run:

python --version

If you get something like Python 3.13.2, you’re set. If not, download Python from python.org and during installation, check the box that says “Add Python to PATH” — this is important.

Step 2 — Create a Virtual Environment

Navigate to the folder where you want your Django project to live, then run:

python -m venv myenv

This creates a folder called myenv containing an isolated Python environment. You can name it anything — I usually name it venv or env.

Step 3 — Activate the Virtual Environment

Using Command Prompt:

myenv\Scripts\activate

Using PowerShell:

myenv\Scripts\Activate.ps1

⚠️ PowerShell Error Fix: If PowerShell gives you an error about execution policies, run this first:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Then try activating again.

Once activated, your terminal prompt will change to show the environment name in parentheses, like this:

(myenv) C:\Users\YourName\myproject>

That prefix tells you the virtual environment is active. Any package you install now goes into myenv only — not your whole system.

Step 4 — Install Django

Now install Django using pip:

python -m pip install Django

This installs the latest stable version of Django (5.2.x as of this writing).

Step 5 — Verify the Installation

Check that Django installed correctly:

python -m django --version

You can refer to the screenshot below to see the output.

django install

You should see something like:

5.2.1

That’s it — Django is installed on your Windows machine!

How to Install Django on Mac

Let me explain to you how to install Django on Mac.

Step 1 — Check Python Is Installed

Open Terminal (Applications → Utilities → Terminal) and run:

python3 --version

If Python isn’t installed, the easiest way on Mac is via Homebrew:

brew install python3

No Homebrew? Install it from brew.sh first.

Step 2 — Create and Activate a Virtual Environment

python3 -m venv myenv
source myenv/bin/activate

Once activated, your terminal prompt will show the environment name:

(myenv) your-mac:myproject yourname$

Step 3 — Install Django

python3 -m pip install Django

Step 4 — Verify

python3 -m django --version

Output: 5.2.1 (or similar)

💡 Note for Mac users: Always use python3 and pip3 on Mac instead of python and pip, unless you’ve set up aliases in your shell config.

How to Install Django on Linux (Ubuntu/Debian)

Here is how you can install Django on Linux.

Step 1 — Update Your Package List

sudo apt update

Step 2 — Install Python and pip if needed

Most Linux distributions come with Python pre-installed. Double check:

python3 --version
pip3 --version

If pip isn’t available:

sudo apt install python3-pip

Step 3 — Create and Activate a Virtual Environment

python3 -m venv myenv
source myenv/bin/activate

Step 4 — Install Django

pip install Django

You can refer to the screenshot below to see the output.

how to install django

Step 5 — Verify

python -m django --version

How to Install a Specific Version of Django

Sometimes you need a specific Django version, maybe you’re following an older tutorial, working on a legacy project, or a client has a version requirement. Here’s how to do it:

Install a specific version:

pip install Django==5.1.