Skip to content

Django Framework Textbook

A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 170 companion flashcards using spaced repetition.

8 chapters · 170 cards · Updated

Chapters

  1. 1Django Fundamentals and Project Layout

    Django is a high-level Python web framework designed for rapid development and clean, pragmatic design. It follows the Model-Template-View (MTV) architectural pattern, which separa...

  2. 2Models, ORM, and Migrations

    Django models are Python classes that subclass django.db.models.Model, with each model mapping to a single database table and each class attribute representing a database column. T...

  3. 3Advanced Querying and Optimization

    The Django ORM lets developers interact with the database using Python code rather than raw SQL. The default manager on every model is objects, and the all() method returns a Query...

  4. 4Views, URLs, and Responses

    Django views are Python callables that take an HttpRequest and return an HttpResponse. Function-based views (FBVs) are simple Python functions, while class-based views (CBVs) subcl...

  5. 5Templates and the Presentation Layer

    Django's template engine uses HTML files with special syntax to separate presentation from logic. Variables are output using double curly braces like {{ variable }}, template tags...

  6. 6Forms, Admin, and Authentication

    Django forms handle HTML form rendering, validation, and data cleaning through Python classes. A form is defined by subclassing forms.Form and declaring fields like CharField and E...

  7. 7Middleware, Security, and File Handling

    Middleware in Django is a framework of hooks that processes requests and responses globally. Each middleware is added to the MIDDLEWARE setting in settings.py and is executed in or...

  8. 8DRF, Signals, Testing, and More

    Django REST Framework (DRF) is a powerful toolkit for building Web APIs on top of Django. Its key components include Serializers for converting models to and from JSON, ViewSets fo...

← Back to the Django Framework deck