On Mon, 2009-02-02 at 10:08 -0800, KJ wrote:
> On Feb 2, 7:11 pm, Christian Joergensen <m...@razor.dk> wrote:
> >
> > Is `todaysdate` listed in your context?
> >
> 
> This is my return line for the view, the locals() part should add all
> the local variables to the template context right?
> 
> return render_to_response('items/browse.html', locals(),
> context_instance=RequestContext(request))

Well, it should. However, that's probably a fairly bad habit to get into
at this early stage. You'll end up passing all sorts of junk to your
templates over time, which will make debugging harder and harder. Having
to worry about whether using a new variable name in your view will
affect your template reduced productivity.

If you rewrite your view to explicitly pass only what you need to the
template and *then* things don't work, debugging will be much easier,
for a start. If it does start working, that would be interesting,
because I can't see why the above code doesn't work, but, then again,
you've only posted small fragments, so it's hard to be sure.

The standard advice applies: create the smallest possible view function
that demonstrates the problem. In the process of doing so, you'll almost
certainly discover what the key line is that is triggering the issue.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to