I'm trying to get my Django fixtures printed in a prettier way.
I've outputting the fixtures:python manage.py dumpdata >> fixture_app.json
This creates a file with 1000's of characters all on one line. When I try to view the file with my Text Editor( TextMate ), the Editor hangs.
Is there anyway that the fixtures can be exported in a prettier way using multiple lines?
You must create a directory in your app named fixtures and put your fixtures files there. You can write them in json or xml, one easy way to make them is to create some objects in the admin interface and then run manage.py dumpdata. That would dump the data from the objects you created into fixture files.
The admin.py file is used to display your models in the Django admin panel. You can also customize your admin panel.
You can try:
python manage.py dumpdata --indent=2
it will be easier to read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With