CommandError: No fixture named 'fixture' found

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 fixture 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_name . not python manage.py loaddata fixture app/fixtures/*.json as you did because fixture will be treated as fixture_name and it is not . thet's why when you removed fixture your code worked

Back to Top