O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15.7.2 Data Migration for Site

To create a new data migration, we create an empty migration with a custom name, as shown in Example 15.33.

Example 15.33: Shell Code

$ ./manage.py makemigrations --empty --name=sites_data core Migrations for 'core':   0001_sites_data.py:

Our first goal is to determine what dependencies our migration has. The sites app has a single migration, defined in django/contrib/flatpages/migrations in the 0001_initial.py file. We therefore change our dependencies list in Example 15.34.

Example 15.34: Project Code

core/migrations/0001_sites_data.py in 40667a7881

36   class Migration(migrations.Migration): 37 38       dependencies = [ 39           ('sites', '0001_initial' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required