for a number of years
I am following the examples in the book The Definitive Guide to Django
and the same error keeps popping up.
"need more than 1 value to unpack"
I understand what it is trying to say, but I do not see where the
problem lies.
I have written 2 almost similar functions.
The first works ( I know that it is not elegant code)
The second gives me the above error.
def current_section(request):
title="This is the best web page"
fp=open('my_page.html')
t=Template(fp.read())
fp.close()
html=t.render(Context({'title':title}))
return HttpResponse(html)
def current_section(request):
title="This is the best web page"
return render_to_response('my_page.html',{'title':title})
Also, in the first fucntion above I am getting the same error when I
use the {% include 'nav.html' %} in my_page.html
and I am also getting the same error when I use template tags.
It is happening in so many areas, that there has to be something
commonly incorrect.
Any suggestions would be much appreciated.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment