django template not resolving context variables
def test(request):
itemgroups = ItemGroup.objects.all()
t = get_template('test.html')
c = {'itemgroups':itemgroups}
return HttpResponse(t.render(c))
In Pycharms editing django template, the variables passed as context is not resolved(does not appear on auto-suggestion) when the view is set as above
def index(request):
itemgroups = ItemGroup.objects.all()
return render_to_response('main.html',{
'itemgroups':itemgroups
},
context_instance=RequestContext(request))
however I found a way around to get the resolved variables in the template, that is by using render_to_response function to render template and context variables.
Is there a way to customize auto-suggestion rules for pycharms editor? thanks in advance!
itemgroups = ItemGroup.objects.all()
t = get_template('test.html')
c = {'itemgroups':itemgroups}
return HttpResponse(t.render(c))
In Pycharms editing django template, the variables passed as context is not resolved(does not appear on auto-suggestion) when the view is set as above
def index(request):
itemgroups = ItemGroup.objects.all()
return render_to_response('main.html',{
'itemgroups':itemgroups
},
context_instance=RequestContext(request))
however I found a way around to get the resolved variables in the template, that is by using render_to_response function to render template and context variables.
Is there a way to customize auto-suggestion rules for pycharms editor? thanks in advance!
Please sign in to leave a comment.