Vijesh Venugopal
Vijesh Venugopal

Reputation: 1641

Validation error with Django model JSONField

I have added a JSONField to a django model. The data gets saved in dictionary format. But when I try to use that field in admin, it says:

Validation Error: [u'Enter valid JSON']

What does this error mean?

models.py:

udf5 = JSONField(_('UDF5'),  max_length=255, blank=True, null=True)

Upvotes: 0

Views: 2172

Answers (1)

Victor Castillo Torres
Victor Castillo Torres

Reputation: 10811

The problem is that the JSON you are inserting is wrong, to validate your JSON you can use jsonlint for example

Upvotes: 2

Related Questions