Cannot dump data using python./manage.py dumpdata application

I created the application in a Django project. For testing purposes, I would like to create artifact files. I found that I can flush my database to automatically create a binding if it already has data. I want to use the device, so I used the python ./manage.py dumpdata app , but returned a list of tons \x02 . But if I use python ./manage.py auth , it works fine. Any idea why my dumpdata only shows \x02 .

Thanks in advance.

I attached a screenshot to the following link:

http://www.cs.ait.ac.th/~fon/wp-content/uploads/2011/01/Screenshot.png

+6
python django fixture
source share
3 answers

I'm not sure I fully understand your question. When you upload data, you need to save it in the device. Check out this blog post: http://solutions.treypiepmeier.com/2008/09/28/use-django-fixtures-to-automatically-load-data-when-you-install-an-app/

Basically, do something like this (replace the name [app_name] with the name of your application):

 python manage.py dumpdata [app_name] > [app_name]/fixtures/initial_data.json 

You will probably need to create a device catalog for your application.

When you run python manage.py syncdb, it automatically searches for appliances in the location [username] /fixtures/initial_data.json

Also, if you do not need. / when you enter python. those. You can write

 python manage.py ... 

but not

 python ./manage.py ... 
+8
source share

you have to run python manage.py dumpdata app > datafile and then load the data with python manage.py loaddata datafile

0
source share
 import dump dump.accept(var, 'file eg: text.txt') 
0
source share

All Articles