I'm trying to use loaddata to load some fixtures into a Django 2.2.10 project. According to the documentation, the command should look like this:
python manage.py loaddata fixture app/fixtures/*.json
However, when I run this command I get the following error:
CommandError: No fixture named 'fixture' found.
I figured the word "fixture" was being interpreted as a path to the fixture, so I removed it and it worked:
python manage.py loaddata app/fixtures/*.json
I still find it weird though that the documentation tells me to do something that doesn't work. Am I missing something? I'm worried that I might have something wrong in my setup that is going to come back to haunt me in the future.
to run fixtures in django. you should follow this syntax:
python manage.py loaddata fixture_namenot :
python manage.py loaddata fixture fixture_nameIn your case you should run
python manage.py loaddata app/fixtures/*.jsoninstead of
python manage.py loaddata fixture app/fixtures/*.jsonbecause fixture here will be treated as fixture_name and it is not .