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!

  1. 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.

    Bash
  2. The One Magic Command – Install Django Run this:

    Bash
    • 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):

      text

    → Takes 10–60 seconds depending on internet.

  3. Verify It Worked (Super Important – Don’t Skip!)

    Three easy ways — pick your favorite:

    Way A – Quick shell check

    Bash

    Way B – Inside Python interpreter

    Bash

    Then inside Python:

    Python

    Way C – pip list (shows everything installed)

    Bash

    You should see:

    text
  4. Bonus: Create requirements.txt Right Now (Future-Proof Habit)

    This file lists exactly what you installed — gold for sharing / deployment.

    Bash

    Peek inside:

    Bash

    Looks like:

    text

    Later: 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

Bash

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! 🚀

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *