Skip to main content
Ctrl+K
  • Django documentation
  • Getting started
  • Using Django
  • How-to guides
  • Django FAQ
  • API Reference
    • Meta-documentation and miscellany
    • Glossary
    • Release notes
    • Django internals
    • Project homepage
  • Django documentation
  • Getting started
  • Using Django
  • How-to guides
  • Django FAQ
  • API Reference
  • Meta-documentation and miscellany
  • Glossary
  • Release notes
  • Django internals
  • Project homepage

Section Navigation

  • How to install Django
  • Models and databases
    • Models
    • Making queries
    • Fetch modes
    • Aggregation
    • Search
    • Managers
    • Performing raw SQL queries
    • Database transactions
    • Multiple databases
    • Tablespaces
    • Database access optimization
    • Database instrumentation
    • Fixtures
    • Examples of model relationship API usage
      • Many-to-many relationships
      • Many-to-one relationships
      • One-to-one relationships
  • Handling HTTP requests
    • URL dispatcher
    • Writing views
    • View decorators
    • File Uploads
    • Django shortcut functions
    • Generic views
    • Middleware
    • How to use sessions
  • Working with forms
    • Formsets
    • Creating forms from models
    • Form Assets (the Media class)
  • Templates
  • Class-based views
    • Introduction to class-based views
    • Built-in class-based generic views
    • Form handling with class-based views
    • Using mixins with class-based views
  • Migrations
  • Managing files
  • Testing in Django
    • Writing and running tests
    • Testing tools
    • Advanced testing topics
  • User authentication in Django
    • Using the Django authentication system
    • Password management in Django
    • Customizing authentication in Django
  • Django’s cache framework
  • Conditional View Processing
  • Composite primary keys
  • Cryptographic signing
  • Sending email
  • Internationalization and localization
    • Translation
    • Format localization
    • Time zones
  • Logging
  • Pagination
  • Security in Django
  • Performance and optimization
  • Serializing Django objects
  • Django settings
  • Signals
  • System check framework
  • Asynchronous support
  • Django’s Tasks framework

Indices

  • General Index
  • Python Module Index
  • Using Django
  • Models and databases

Models and databases#

A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you’re storing. Generally, each model maps to a single database table.

  • Models
  • Making queries
  • Fetch modes
  • Aggregation
  • Search
  • Managers
  • Performing raw SQL queries
  • Database transactions
  • Multiple databases
  • Tablespaces
  • Database access optimization
  • Database instrumentation
  • Fixtures
  • Examples of model relationship API usage

previous

How to install Django

next

Models

Show Source

© Copyright Django Software Foundation and contributors.

Last updated on Jul 17, 2026.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.20.0.