Ska
Ska

Reputation: 6888

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)

Upvotes: 15

Views: 7610

Answers (2)

Darrin Perry
Darrin Perry

Reputation: 11

debian based linux - ubuntu etc etc

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

Upvotes: 1

Abid A
Abid A

Reputation: 7858

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

> pip install pyyaml

Upvotes: 40

Related Questions