© Daniel Rubio 2017

Daniel Rubio, Beginning Django, https://doi.org/10.1007/978-1-4842-2787-9_7

7. Django Models

Daniel Rubio

(1)F. Bahia, Ensenada, Baja California, Mexico

The typical way for Django applications to interact with data is through Django models. A Django model is an object-oriented Python class that represents the characteristics of an entity. For example, an entity can be a person, a company, a product, or some other concept used by an application.

Because data is at the center of modern applications and the Django framework enforces the DRY (Don’t Repeat Yourself) principle , Django models often serve as the building blocks for Django projects. Once you have a set of Django models representing an application’s entities, Django models ...

Get Beginning Django: Web Application Development and Deployment with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.