from pinplace.pincode.models import * from django.template import loader from django import newforms as forms def index(request): t = loader.get_template('/home/shriphani/pinplace/pincode/index.html') def index2(request): p=request.POST['pincode'] s = Pin_Of_Place.objects.filter(Pincode=pincode) if s == '[]': return HttpResponse("We do not have this pincode in our database") else: return HttpResponse(s)