Hello,

You're assuming that form are called only from views. Some Form methods are mostly used inside templates like as_p for example. Another assumption you made is that all url point to html ressources. Images, javascripts can have their url. Generation of pdf, csv and AJAX mechanics are other examples.

As far as I understand, you want to display a login form in all your html pages. My first thought is to place it in a template extended by all html pages (I think about Django documentation 'base.html' template). You can't call the form's as_p (or whatever you want) as the form is missing from your context and built-in template tags and filters do not provide directly (AFAIK) what you need for that purpose but you can write your own [1][2].

Your context already provides request.user; you can use it to display login form or logout link according this context.

I don't know if this is a correct way to handle the case: maybe I'll do it another way with experience. The purpose is to point that you don't necessaraly need to work on "every function" from your views.

Regards


[1] http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
[2] http://docs.djangoproject.com/en/dev/topics/auth/#module-django.contrib.auth.forms


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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