Created
September 7, 2019 15:58
-
-
Save menecio/503483c7be3bd55bc66b942e75c32da5 to your computer and use it in GitHub Desktop.
This file contains 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.serializers import serialize | |
from django.http import HttpResponse | |
from .models import Movie | |
def movies_list(request): | |
queryset = Movie.objects.all() | |
content = serialize('json', queryset) | |
return HttpResponse(content=content, content_type='application/json') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment