Last active
August 29, 2015 14:09
-
-
Save bekatom/c5a4ae58a9c900e6460a to your computer and use it in GitHub Desktop.
django object to json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.core import serializers | |
| def tst (request): | |
| test = Tourist.objects.all() | |
| data = serializers.serialize("json", test) | |
| return HttpResponse(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment