python - Django initial data serialization error -


i trying provide initial data model in django. when try run python manage.py loaddata <fixture path> following error:

django.core.serializers.base.deserializationerror: problem installing  fixture '/home/location/fixtures/initial_data.json':  expecting property name enclosed in double quotes: line 7 column 10 (char 119) 

my fixtures or initial data this:

[ {     "model": "location.zipcode",     "pk": 1,     "fields": {       "zipcode": 79936,      } }, {     "model": "location.zipcode",     "pk": 2,     "fields": {         "zipcode": 90011,     } } ] 

i have zipcode integerfield in zipcode model. appreciated.

trailing commas not valid in json remove them.
give:

[ {     "model": "location.zipcode",     "pk": 1,     "fields": {       "zipcode": 79936      } }, {     "model": "location.zipcode",     "pk": 2,     "fields": {         "zipcode": 90011     } } ] 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -