Skip to content

django

Use when working with Django views, URL routing, templates, middleware, signals, admin, management commands, or settings configuration. Also use when adding async support to Django views, debugging N+1 queries, or setting up pytest-django for testing.

ModelSource
sonnetpack: python
Full Reference

Django 5.x is a batteries-included Python web framework. It owns the full stack: ORM, views, templates, URL routing, admin, auth, and middleware. Django 5.0 introduced GeneratedField and field-level facets; 5.1 added async auth backends; 5.2 added async user model methods and method_decorator support for async view methods.

ItemValue
Django version5.2
Dev serverpython manage.py runserver
Create migrationspython manage.py makemigrations
Run migrationspython manage.py migrate
Run testspytest (pytest-django) or python manage.py test <app>
Check prod configpython manage.py check --deploy
Settings patternSplit: base.py / local.py / production.py
I want to…File
Structure a Django project and configure split settingsreference/project-structure.md
Write function-based and class-based views (including async)reference/views.md
Configure URL routing and namespacingreference/url-routing.md
Write custom middleware (sync and async compatible)reference/middleware.md
Use signals and connect them safely via AppConfig.ready()reference/signals.md
Write custom management commandsreference/management-commands.md
Customize the Django admin (list_display, actions, fieldsets)reference/admin.md
Test Django views and models with pytest-djangoreference/testing.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.


┏━ 🐍 django ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Full-stack Python web framework — views, routing, admin, and more ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛