hi atendo,

Atendo wrote:
> If I do that, I get this error:
> 
> ------------------------------------------------
> KeyError at /
> 'link'
> Request Method:       GET
> Request URL:  http://localhost:8080/
> Exception Type:       KeyError
> Exception Value:      'link'
> ------------------------------------------------

this KeyError is coming from your line:

------------------------------------------------
context['link']
------------------------------------------------

when 'link' isn't actually part of the template's context (and therefore
not a valid key to the dictionary-like object 'context').  if you'd like
to more-or-less silently ignore this error for now you can use instead

------------------------------------------------
context.get('link')
------------------------------------------------

which will return None if link isn't part of the context.

best,
jake

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to