Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django fixtures not accepting YAML?

$ python manage.py loaddata fixtures/initial_data.yaml 
Problem installing fixture 'fixtures/initial_data': yaml is not a known serialization format.
$ 
$ python manage.py loaddata fixtures/initial_data.yml 
Problem installing fixture 'fixtures/initial_data': yml is not a known serialization format.

According to Django documentation this format should be supported, but I get the above errors. JSON on the other hand works ok.

Django version:

django.VERSION (1, 3, 1, 'final', 0)

like image 771
Ska Avatar asked Oct 19 '11 23:10

Ska


2 Answers

.yaml is what you want. Make sure YAML is installed and available to Python by running:

> pip install pyyaml
like image 185
Abid A Avatar answered Nov 04 '22 15:11

Abid A


debian based linux - ubuntu etc etc

sudo apt-get install python-yaml
or
apt-get install python-yaml

like image 42
Darrin Perry Avatar answered Nov 04 '22 16:11

Darrin Perry