Forums

Django fixtures

Is there any reason loading fixtures would not work on pythonanywhere? I've set them up correctly I believe. They are inside the app in fixtures/appname/fixturename.json. I've tried renaming the file a few times to see if it was not reading special characters correctly and loading it with fixturename.json and just fixturename but it still just gives me the message No fixture named <'fixturename'> found.

There's nothing PythonAnywhere-specific that I can think of. Are you sure they're in the right place -- the fixtures subdirectory of your Django app?

They are. Using the full path to file worked though.
python manage.py loaddata (app_name)/fixtures/(app_name)/(fixture_name).json

Django says it looks in that directory by default so I did not include the path but once I did it worked fine.

Hmm, are you sure that's the right path? My reading of the Django docs is that they should go in (app_name)/fixtures/(fixture_name).json

I guess it doesn't say but I kinda assumed it was structured the same way as templates stored within the app with the extra app_name folder.

One thing to check might be that you're using the right version of django? are you using a virtualenv?