Chapter 3: Django Getting Started

Django Getting Started step-by-step, like I’m your senior sitting next to you on a shared screen, explaining why we do each thing, what can go wrong (very common in India with different Python installs), and giving real examples.

We’re using the current stable version as of January 31, 2026: Django 6.0.1 It works beautifully with Python 3.12, 3.13, or 3.14 (official support).

Goal today:

  • Install everything cleanly
  • Create your first project
  • Run the magic “It worked!” page
  • Understand the folder structure
  • Avoid the top 5 beginner mistakes I see in Hyderabad meetups

Step 0: Prerequisites (5–10 min – do this first!)

  1. Python installed? Open your terminal (PowerShell / CMD on Windows, Terminal on macOS/Linux) and type:

    Bash

    You need 3.12 or newer.

    • If not → download from https://www.python.org/downloads/ (In 2026, pick Python 3.13 or 3.14 — both fine with Django 6.0)
    • Windows tip: Check “Add Python to PATH” during install
    • macOS/Linux: Use brew install python@3.13 or apt if needed
  2. pip up to date? (very important – old pip causes weird errors)

    Bash
  3. Code editor

    • VS Code (free, best for Django in 2026) + install extensions: Python (by Microsoft), Django (by Baptiste Darthenay), Pylance
    • Or PyCharm Community (free) — auto-detects Django projects nicely

Step 1: Create a dedicated project folder (organization matters!)

Don’t code on Desktop or Downloads — future you will thank you.

Bash

(Use mkdir myfirstdjango if you hate hyphens)

Step 2: Virtual environment – never skip this!

Why? Global Python install gets polluted → version conflicts → tears.

Modern way (2026 standard):

Bash

Activate it:

  • Windows (CMD/PowerShell):

    Bash
  • macOS / Linux / Git Bash:

    Bash

You’ll see (venv) appear in prompt → success!

Common mistake: Forgetting to activate → installs packages globally → breaks other projects.

Step 3: Install Django 6.0.1 exactly

Bash

Why specific version?

  • Avoids “works on my machine” issues
  • Matches official tutorial for 6.0

Check:

Bash

Step 4: Create your first Django project

Bash

Important: The dot (.) at the end → creates project in current folder (cleaner than nested folders).

Now your structure looks like this:

text

manage.py is like your project’s remote control.

Step 5: Run the development server – magic moment!

Bash

Or shorter:

Bash

Open browser → http://127.0.0.1:8000/

You should see:

The install worked successfully! Congratulations!

With a big rocket 🚀 and “Django” logo.

→ This page proves: Python → Django → web server → browser all connected!

Press Ctrl + C to stop server.

Step 6: Quick tour of what just happened (the “Aha!” part)

When you visit /:

  1. Browser sends GET request to Django

  2. Django reads mysite/urls.py (your routing map)

    Default looks like:

    Python

    No root path → Django shows default welcome page.

  3. No database needed yet → pure Python response.

Step 7: Small customization – change welcome message (first edit!)

Open mysite/settings.py

Find:

Python

Change to (for local dev only – we’ll secure later):

Python

Now create a tiny view.

Create file mysite/views.py (new file!)

Python

Now edit mysite/urls.py:

Python

Restart server (python manage.py runserver)

Refresh http://127.0.0.1:8000/ → your custom Telugu + English greeting!

Top 5 mistakes beginners make (and how to fix fast)

  1. “command not found: django-admin” → Forgot to activate venv or didn’t install Django inside venv
  2. Port 8000 already in use → Run python manage.py runserver 8001 or kill old process
  3. TemplateDoesNotExist (later) → Wrong folder structure — templates must be in right place
  4. ModuleNotFoundError: No module named ‘mysite’ → Ran commands outside project folder or wrong cd
  5. Windows path issues → Use python not py, or add to PATH properly

What next? (Your homework / our next session)

You now have a running Django project!

Options:

  • Follow official poll tutorial (Part 1–7) → best structured learning → https://docs.djangoproject.com/en/6.0/intro/tutorial01/
  • Add a simple templates folder + HTML page (more beautiful than HttpResponse)
  • See the famous admin panel (/admin/ → create superuser)
  • Or build a mini “Hello + current time” dynamic page

Tell me what you want next:

  • “Let’s do the official poll tutorial step by step”
  • “Show me how to add HTML templates properly”
  • “How to use Django admin right now”
  • “I got an error — here it is…”

I’m here — let’s keep building! 💻🇮🇳

You may also like...

Leave a Reply

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