Chapter 5: Install Django
Today we’re focusing only on installing Django — the exact moment you go from “I have Python” to “Django is ready in my project”.
This is after you’ve already created & activated a virtual environment (from our last chat). If you haven’t, stop here, go back, and do python -m venv venv + activate it first — installing globally is like pouring cement in the wrong place.
We’re using Django 6.0.1 — the current stable patch release as of January 31, 2026 (released Jan 6, 2026 — bugfix on top of the big 6.0 from Dec 3, 2025). It supports Python 3.12 – 3.14.
Why Install a Specific Version? (Quick Real-Talk)
- pip install django → gets the absolute latest (right now 6.0.1)
- pip install Django==6.0.1 → locks it exactly (recommended for learning/tutorials — avoids surprises if 6.0.2 drops tomorrow)
- Use == for reproducibility — your friend in another city can run the same commands and get identical setup
Step-by-Step: Installing Django (Inside Your Activated venv)
Make sure your terminal shows (venv) at the start — that’s your private kitchen!
-
Double-check you’re in the right place You should be inside your project folder (e.g. my-first-django/ or django-learn-2026/) and venv activated.
Bash012345678910# Quick checks (optional but smart)pwd # shows current folder pathpython --version # should be your expected 3.12/3.13/3.14pip --version # should point inside venv/.../pippip list # should show almost nothing yet (maybe pip & setuptools only) -
The One Magic Command – Install Django Run this:
Bash0123456pip install Django==6.0.1-
On Windows (if python is py alias sometimes): py -m pip install Django==6.0.1
-
It will download ~10–15 MB (fast on good net, bearable on Jio 4G)
-
Output looks like this (excerpt):
text012345678910111213Collecting Django==6.0.1Downloading Django-6.0.1-py3-none-any.whl (8.3 MB)Collecting asgiref<4,>=3.8.1Downloading asgiref-3.8.1-py3-none-any.whl (23 kB)Collecting sqlparse>=0.3.1Downloading sqlparse-0.5.1-py3-none-any.whl (44 kB)Installing collected packages: sqlparse, asgiref, DjangoSuccessfully installed Django-6.0.1 asgiref-3.8.1 sqlparse-0.5.1
→ Takes 10–60 seconds depending on internet.
-
-
Verify It Worked (Super Important – Don’t Skip!)
Three easy ways — pick your favorite:
Way A – Quick shell check
Bash01234567python -m django --version# Should print exactly: 6.0.1Way B – Inside Python interpreter
Bash0123456pythonThen inside Python:
Python0123456789>>> import django>>> django.get_version()'6.0.1'>>> exit()Way C – pip list (shows everything installed)
Bash0123456pip listYou should see:
text0123456789101112Package Version---------- -------asgiref 3.8.1Django 6.0.1pip 24.x.x # whateversetuptools ...sqlparse 0.5.1 -
Bonus: Create requirements.txt Right Now (Future-Proof Habit)
This file lists exactly what you installed — gold for sharing / deployment.
Bash0123456pip freeze > requirements.txtPeek inside:
Bash0123456cat requirements.txt # or type requirements.txt on WindowsLooks like:
text012345678asgiref==3.8.1Django==6.0.1sqlparse==0.5.1Later: friend does pip install -r requirements.txt → same setup.
Common Mistakes & Fixes (Hyderabad Special Edition)
- “No module named django” after install → Forgot to activate venv → packages went to global Python. Fix: deactivate → activate again → reinstall.
- Permission denied / access error (rare on Windows/Linux) → Don’t use sudo! Just make sure venv is activated.
- Very slow download → Use a mirror if needed: pip install Django==6.0.1 -i https://pypi.douban.com/simple (Chinese mirror, sometimes faster in Asia)
- “Could not find a version that satisfies…” → Wrong Python version (Django 6.0 needs 3.12+). Check python –version.
- Wheel building errors (very rare now) → Update pip first: python -m pip install –upgrade pip
What Just Happened? (The Aha Moment)
- pip downloaded Django + its 2 tiny dependencies (asgiref for async, sqlparse for SQL cleaning)
- Installed them only inside your venv/
- Now your Python knows what import django means
- You’re ready for django-admin startproject — the next big step
Quick Test – See If Django CLI Works
|
0 1 2 3 4 5 6 7 |
django-admin --version # Again: 6.0.1 |
If this prints → boom! Django is installed and usable.
Now you’re set, boss!
Next logical move?
- “Okay, now show me creating the first project with startproject”
- “How do I upgrade to a newer patch if 6.0.2 comes?”
- “What if I want the absolute latest instead of ==6.0.1?”
- Or paste any error you hit — we’ll squash it in seconds
Your setup is almost alive — tell me what’s next! 🚀
