views.py 377 Bytes
Newer Older
1
2
3
4
5
6
7
8
from django.http import JsonResponse

def index(request):
    id = request.GET.get('id', '')
    name = 'Joel'
    price = 1.2
    imageURL = 'https://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&MarketPlace=US&ASIN=' + id + '&ServiceVersion=20070822&ID=AsinImage&WS=1&Format=SL250'
    return JsonResponse({'id': id, 'name': name, 'price': price, 'imageURL': imageURL})