3.5.1 Understanding Migrations

Models allow us to define the structure, relations, and behavior of the data we use on our website. The behavior we’ve defined will have a direct effect on our use of the data in Python (as we shall see in the next section), but the structure we’ve created is just an abstraction for how the data will be stored in the database. In Django, models and the database schema are reflections of one other. Any modification of one must result in the modification of the other. In a fully deployed team project, this can be quite tricky. If one developer makes a change to his or her local test database, he or she needs a way to share these changes with other developers and the various servers running the website(s) in a repeatable ...

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.