3.4.1 A First Look at Django Models and Fields

The goal of this section is to transform the preceding list into code that Django understands. Django will handle communication with the database for us, going so far as to generate a database. It will allow us to abstract database queries and data validation for input. Overall, we will save an enormous amount of time by avoiding writing all of the code necessary for these tasks and simplifying code throughout the project. The trick is to maintain app encapsulation and to put the code in the right place.

Specifying how data is organized in Django is simple and one of Django’s most exciting features. Django provides declarative syntax for the purpose of understanding models, based on Python classes. ...

Get Django Unleashed 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.