15.7.1 The Core App

The obvious solution to our problem is to create a data migration (as seen in Chapter 10: Revisiting Migrations).

This approach comes with a minor problem: migrations are associated with apps, and the apps we are trying to create migrations for are in Django’s source code, not in our own project. We could create the migrations in one of our existing apps, but this approach is frowned upon. Instead, the best-practice is to create a new app whose entire purpose is to handle interaction with Django’s contributed library. To that end, in Example 15.31, we create the core app with a migrations package to create data migrations for both sites and flatpages. Rather than use startapp, we can simply create a package named core, followed ...

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.