Django documentation#
Everything you need to know about Django.
First steps#
Getting started: Django at a glance | Installation | Third-party distributions
The tutorial takes you by the hand through a series of steps to create a web application.
Tutorial: Part 1: Setting things up | Part 2: Models and the admin site | Part 3: Views and templates | Part 4: Forms and generic views | Part 5: Testing | Part 6: Static files | Part 7: Customizing the admin site | Part 8: Adding third-party packages
After that, there are some tutorials dedicated to particular topics.
Follow-on tutorials: How to write reusable apps | Writing your first contribution to Django
The model layer#
A Django model is a representation of the objects your application will handle, described in Python, and stored in a database.
Models: Introduction to models | Field types | Custom fields | Indexes | Meta options | Model class | Managers
Model instances and relations: Instance methods | Accessing related objects | Content types and generic relations
Queries: Making queries | QuerySet method reference | Lookup expressions | Query Expressions | Conditional Expressions | Custom lookups | Aggregation | Database Functions | Raw SQL
Migrations: Introduction to Migrations | Operations reference | SchemaEditor | Writing migrations
Other: Transactions | Search | Multiple databases | Providing initial data | PostgreSQL specific features
The view layer#
Django views contain the logic responsible for processing a user’s request and for returning the response.
The basics: URLconfs | View functions | Shortcuts | Decorators | Asynchronous Support | Conditional view processing
Reference: Built-in Views | Request/response objects | TemplateResponse objects
Class-based views: Introduction to class-based views | Built-in display views | Built-in editing views | Using mixins | API reference | Flattened index
Middleware: Introduction to middleware | Built-in middleware classes
Other output formats: Generating CSV | Generating PDF
The template layer#
The template layer provides a designer-friendly syntax for rendering the information to be presented to the user. Template functionality can also be customized.
The basics: Templates | Language overview | Built-in tags and filters | Humanization | Template API
Customization and extension: Custom tags and filters | Custom template backend
Other core functionality#
Configuration: Django settings | Full list of settings | Applications
Exceptions: Django exceptions
Management commands: django-admin and manage.py | Adding custom commands
User-facing features#
Admin: Admin site | Admin actions | Admin documentation generator
Content: Flatpages | Redirects | Pagination | Messages framework
Forms: Working with forms | The Forms API | Built-in fields | Built-in widgets | Forms for models | Integrating media | Formsets | Customizing validation
Internationalization and localization: Introduction to internationalization | Translation | Format localization | Time zones | Unicode data
Authentication: User authentication | Using the authentication system | Password management | Customizing authentication | API Reference
Geographic data and representation: GeoDjango
Developer-facing features#
Core features: The sites framework | Sessions | Static files management
Project-level features: Caching | Logging | System check framework
Backend processing: Tasks framework | Signals
Data management: Serialization | Data validation
Discoverability: Sitemaps | Syndication feeds (RSS/Atom)
Resources and interfaces#
Databases: Supported databases | Legacy databases
Storage: File uploads | File objects | Storage API | Managing files | Custom storage
Deployment: How to deploy Django | WSGI servers | ASGI servers | Deploying static files | Tracking code errors by email | Deployment checklist
Email: Sending messages
Quality and dependability#
A key concern in Django’s design philosophy is to make it easier to build applications that work safely and efficiently, in the real world.
Testing: Introduction | Writing and running tests | Included testing tools | Advanced topics
Security: Security overview | Disclosed security issues in Django | Clickjacking protection | Cross Site Request Forgery protection | Cryptographic signing | Security Middleware | Content Security Policy
Performance: Performance and optimization overview | Optimize database access
The Django open-source project#
Django moves forward steadily, thanks to a rigorous development process and a supportive community that welcomes new contributors:
Community: Contributing to Django | Team organization | The Django source code repository | Mailing lists and Forum
Processes and policies: The release process | Security policy | Design philosophies
Django over time: API stability | Release notes and upgrading instructions | Deprecation Timeline
Getting help#
Having trouble? We’d like to help!
Try the FAQ – it’s got answers to many common questions.
Looking for specific information? Try the Index, Module Index or the detailed table of contents.
Not found anything? See FAQ: Getting Help for information on getting support and asking questions to the community.
Report bugs with Django in our ticket tracker.
How the documentation is organized#
The table of contents above unfolds Django’s documentation thematically. Pages themselves are organized into an underlying hierarchy according to type, to help navigate the site:
The tutorial takes you by the hand through a series of steps to create a web application. Start here if you’re new to Django or web application development.
Topic guides explain Django’s functionality in detail and provide an overview of key concepts and how individual parts of Django can be used.
Reference guides contain technical reference for APIs and other aspects of Django’s machinery.
How-to guides guide you through the work to address real-world problems and use-cases.