def index (request):
return HttpResponse(request, 'index')
def page (request, page_num):
return HttpResponse(f'Page {page_num}')
def about(request, id):
try:
var = Product.objects.get(pk=id)
except Product.DoesNotExist:
raise Http404('Not found')
return HttpResponse('OK')
def json_show (req):
data = {'cost':2, 'title':'book'}
return JsonResponse(data)