Putting a django login form on every page
|April 29, 2010||Posted by forumadmin under TechQns||
I’d like the login form (AuthenticationForm from django.contrib.auth) to appear on every page in my site if the user is not logged in. When the user logs in, they will be redirected to the same page. If there is an error, the error will be shown on the same page with the form.
I suppose you’d need a context processor to provide the form to every template. But, then you’d also need every view to handle the posted form? Does this mean you need to create some middleware? I’m a bit lost.
Is there an accepted way of doing this?
|Asked By – asciitaxi||Read Answers|