Quoting from Django Website:
If you create a fixture named
fixture will be loaded every time you
run syncdb. This is extremely
convenient, but be careful: remember
that the data will be refreshed every
time you run syncdb. So don’t use
initial_data for data you’ll want to
So I guess there’s no way to say “okay, don’t load initial data just this once”. Perhaps you could write a short bash script that would rename the file. Otherwise you’d have to dig into the Django code.
You might want to think about whether
initial_data.json is something your app actually needs. It’s not hard to “manually” load your production data with
./manage.py loaddata production.json after running a
syncdb (how often do you run
syncdb in production, anyway?), and it would make loading your testing fixture much easier.
- How to get average from set of objects in Django?
- Making Django development server faster at serving static media
- Getting "This field is required" even though file is uploaded
If you want to have tables with no initial data, this code will help you:
from django.core import management
management.call_command('flush', interactive=False, load_initial_data=False)
this will remove your data and syncdb again without loading initial data.
- Celery restart loss scheduled tasks
- Cannot connect to localhost API from Android app
- Django DB level default value for a column
- Can we have Django DateTimeField without timezone?