Django · Intermediate

Django Fundamentals

Go from plain Python scripts to a real, structured web application: URLs, views, templates, and talking to a database.

Units
4
Lessons
20
Practice questions
62
Minutes
~300

Start learning today

Try every course free for 7 days. After that, this course is in Learnix Pro (KES 699/month).

Create free account Log in

What you'll learn

Understand what a web framework actually does for you

Define URLs and connect them to views

Render HTML pages with Django's template language

Define a model and let Django manage the database table for you

Handle form submissions safely

Use the Django admin to manage data without writing extra code

How the lessons work

Clear explanations

Step-by-step lessons in plain language

28 in this course

Worked examples

Real code and examples you can copy and run

73 in this course

Quick checks

Test your understanding as you go

38 in this course

Fill the blank

Recall the key commands and syntax

20 in this course

Hands-on workspace

A practical task at the end of every lesson

20 in this course

Syllabus

  1. 1.1

    What is Django, and Why Use a Framework?

    Writing a real website in plain Python means solving the same problems every project needs: Django solves most of them for you, so you can focus on what makes YOUR site different.

  2. 1.2

    Projects, Apps & Settings: How a Django Project Is Organised

    Create a project the professional way (virtual environment, apps, settings and secrets) and understand what every generated file is for.

  3. 1.3

    URLs and Views

    A URL pattern says "when someone visits this address, run this piece of code": that piece of code is called a view.

  4. 1.4

    Templates

    A template is mostly ordinary HTML, with a small bit of extra syntax that lets you drop in real data and repeat or branch based on it.

  5. 1.5

    Template Inheritance, Tags, and Filters

    Copy-pasting the same header and navigation into every single template is exactly the repetition Django's template inheritance exists to eliminate.

  1. 2.1

    Models & the ORM

    A Model is a Python class that represents a database table: Django's ORM lets you query and save data using normal Python, with no SQL required.

  2. 2.2

    Model Relationships: ForeignKey, ManyToMany & OneToOne

    Link models the way real data is linked: orders belong to customers, products have many tags, each user has one profile.

  3. 2.3

    Powerful ORM Queries: Q, F, annotate & select_related

    Write the queries real apps need (OR conditions, calculations, totals per group) and avoid the N+1 problem.

  4. 2.4

    The Django Admin & Basic CRUD

    Django can generate a working admin panel for managing your data automatically, from just a few lines, and CRUD (Create, Read, Update, Delete) is just as short in regular views.

  5. 2.5

    Static Files & Image Uploads

    Serve CSS, JavaScript and logos as static files, and let users upload product photos and documents as media.

  1. 3.1

    Forms

    Django's Form classes handle displaying an HTML form AND validating what comes back, both from the same definition.

  2. 3.2

    ModelForms: Forms That Match Your Models

    A ModelForm builds an entire form directly from a Model's fields, so you never have to declare the same fields twice and keep both copies in sync by hand.

  3. 3.3

    User Authentication: Login, Logout, and Registration

    Django ships with a complete, battle-tested authentication system out of the box: you almost never need to write your own password hashing or session handling.

  4. 3.4

    Permissions, Groups & Protecting Views

    Control who can see and do what: login-only pages, owner-only edits, staff areas and group-based permissions.

  5. 3.5

    Flash Messages, Pagination & Search

    Give users feedback after actions, split long lists into pages, and add a search box.

  1. 4.1

    Class-Based Views vs Function-Based Views

    Every view so far has been a plain function: Django also lets you write views as classes, which can save real repetition for common patterns like "list all of these" or "show one of these".

  2. 4.2

    Building a REST API with Django REST Framework

    Expose your data as JSON for mobile apps and JavaScript front ends with serializers, viewsets and token authentication.

  3. 4.3

    Testing Django Apps

    Write tests for models, views and permissions with Django's test client, so you can change code without fear.

  4. 4.4

    Mini Project: Adding Comments to a Blog Post

    Let's connect everything from this course into one real feature (a Model, a ForeignKey relationship, a ModelForm, a view, and a template) by adding comments to a blog post.

  5. 4.5

    Deploying Django to Production

    Take your Django site live with Gunicorn, a real database, static files, environment variables and the security checklist.

Earn a verifiable certificate

Finish every lesson and pass the 20-question final exam (70% to pass). Each certificate has a unique number anyone can check online.

Get started

Helping with:

🍪 We use essential cookies to keep you signed in, protect your account and remember your settings. We don't use advertising or tracking cookies. Read our Privacy Policy.