Pages

Topics

Tools

↑↓navigate↵openescclose

All syntax guides

Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.

3,965 guides across 14 topics

Topics

Latest guides

Illustration of a Django async view processing requests concurrently with an event loop.
Python

Python Django Async Views: When and How to Use Them

Django async views can improve throughput for I/O-bound work, but they require care with the ORM and other synchronous code. Learn when to use them and how to handle database access safely.

DjangoAsyncASGIPython
Diagram of Django caching layers showing view, template, and low-level cache with Redis backend.
Python

Python Django Caching: Strategies for Faster Views

python django caching: Learn how to implement Python Django caching with per-view, template fragment, and low-level cache APIs to reduce database load and speed up res...

DjangoCachingPerformanceRedis
Diagram showing the separation between Django static files and user-uploaded media files
Python

Handling Django File Uploads and Static Files

How Django separates user-uploaded media from static files, with configuration steps for MEDIA_ROOT, STATIC_ROOT, forms, validation, collectstatic, and storage backends.

DjangoFile UploadsStatic FilesMedia Files
Illustration showing a Django request passing through middleware layers while signals broadcast events to connected handlers.
Python

Python Django Middleware and Signals: When to Use Each

Learn how Django middleware and signals differ, when to use each, and how to implement them correctly in real Django applications.

DjangoMiddlewareSignalsRequest Lifecycle
Illustration of Django authentication and permission system with custom user model
Python

Django Authentication, Permissions, and Custom User Models

How to use a custom Django user model with email-based login, manage permissions and groups, and enforce access control in views and templates.

DjangoAuthenticationPermissionsCustom User Model
Illustration of Django forms and ModelForm showing form fields and model relationship
Python

Python Django Forms and ModelForm: Practical Usage

python django forms and modelform: Learn how to use Django forms and ModelForm for validation, rendering, and saving data. Understand when to use each approach.

DjangoFormsModelFormValidation
Diagram showing Django ORM annotate and aggregate operations combined with a transaction lock, representing computed fields and atomic database updates.
Python

Django Annotations, Aggregation, and Transactions

Learn how Django's annotate() and aggregate() methods compute values in querysets, how to group and filter those results, and how to wrap multi-step updates in atomic transactions.

DjangoORMAnnotationsAggregation
Illustration of Django ORM query optimization showing select_related and prefetch_related reducing database queries.
Python

Django select_related and prefetch_related: Fix N+1 Queries

Learn how to eliminate N+1 queries in Django with select_related and prefetch_related, including practical examples, when to use each, and common pitfalls.

DjangoORMN+1Query Optimization
Diagram of Django model relationships showing one-to-one, one-to-many, and many-to-many with tables and connection lines.
Python

Python Django Foreign Key, One-to-One, and Many-to-Many

Learn how to model many-to-one, one-to-one, and many-to-many relationships in Django with ForeignKey, OneToOneField, and ManyToManyField.

DjangoORMDatabase RelationshipsForeignKey
Django ORM operations diagram showing filter, get, exclude, create, update, and delete on a database table.
Python

Python Django ORM: filter, get, exclude, create, update, and delete

Learn how to use Django's ORM methods filter, get, exclude, create, update, and delete to query and modify database records.

DjangoORMQuerySetCRUD