在我的Django模板中,我使用$ .ajax jquery方法,其中url指向我的一個django視圖。現在我如何在這個Django視圖中使用render_to_response?jquery回電Django模板
def document_status(request):
if request.method == u'GET':
GET = request.GET
if GET.has_key(u'doc_type') and GET.has_key(u'iqama_no'):
pass
json_response = simplejson.dumps({'res':True})
#return HttpResponse(json_response, mimetype='application/json')
return render_to_response('tracking/index.html')
你的代碼有什麼問題? –
上面的視圖是通過jquery $ .ajax方法調用的。現在我想重定向到索引模板,但上面的代碼不會重定向到index.html模板。有什麼辦法重定向到jQuery中的回調特定的Django模板? – Asif