how to convert a queryset into json string

JavaScript
# Simply wrap the queryset in a list

data = list(queryset.values())

# Hint: need to use .values() not .all()
Source

Also in JavaScript: