[Django]-Python manage.py syncdb does not automatically load initial_data.json fixture in Python Django

1👍

I had the same problem, and I solved it by adding a few lines in my settings.py

FIXTURE_DIRS = (
    os.path.join(BASE_DIR, 'hello/fixtures'),
)

3👍

If you are using Django version 1.7 or later, you should probably know that automatic loading of fixtures has been deprecated:

If an application uses migrations, there is no automatic loading of fixtures. Since migrations will be required for applications in Django 2.0, this behavior is considered deprecated. If you want to load initial data for an app, consider doing it in a data migration.

If you’re using the new built-in migrations, automatic loading of fixtures won’t work.

👤Chris

Leave a comment