Re: Unable to access view variable

2014-10-16 Thread shmengie
To reference "pers" in your template as stated, your dictionary should be {"pers": pers} return render_to_response('index.html', {"pers": pers}) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivin

Re: Unable to access view variable

2014-10-16 Thread Vijay Khemlani
You need to pass a dictionary as a second parameter to the render_to_response method with the variables that you wish to access in the template. for example: return render_to_response('index.html', {"people_info": pers}) that way you can access the variable "people_info" in the template. On Th

Unable to access view variable

2014-10-16 Thread Sachin Tiwari
Hi , I have below lines in view.py and acesssing this variable in html but not getting output, def index (request): pers = list(PersonInfo.objects.filter()) return render_to_response('index.html') html code {% for id in p