Thursday, May 19, 2011

Re: Built-in login form via inclusion tag

> On 13 Maj, 14:55, Gabe <gabriel.filip...@gmail.com> wrote:
...
> > It seems like it don`t know enything about form variable. How can I
> > give it to it via inclusion tag?

You should return template context with `form` variable::

from django.contrib.auth.forms import AuthenticationForm

@register.inclusion_tag("you_template.html")
def login_tag():
form = AuthenticationForm()
return {"form": form,}

--
Kirill Spitsin

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate