Created
February 9, 2018 10:59
-
-
Save filipgorczynski/2d88596364a238ee385ac3f95f5bf0c7 to your computer and use it in GitHub Desktop.
views.py for movies application
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.http import JsonResponse | |
def top_rated(request): | |
return JsonResponse( | |
[ | |
{ | |
'title': 'Skazani na Shawshank', | |
'year': 1994 | |
}, | |
{ | |
'title': 'Ojciec chrzestny', | |
'year': 1972 | |
}, | |
{ | |
'title': 'Ojciec chrzestny II', | |
'year': 1974 | |
}, | |
{ | |
'title': 'Mroczny Rycerz', | |
'year': 2008 | |
}, | |
{ | |
'title': 'Dwunastu gniewnych ludzi', | |
'year': 1957 | |
} | |
], | |
safe=False | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment