That will improve the situation a lot, thanks! It doesn't change the fact that it would feel more correct to have it in an authentication backend :)
On Mon, Apr 26, 2010 at 5:40 PM, Joe <joesacco...@gmail.com> wrote: > > On Apr 26, 5:42 am, Martin Lundberg <martin.lundb...@gmail.com> wrote: > > I was told to create a middleware which I did but it feels wrong since > > it is called on every request for everything. And if I add > > authentication by Twitter and maybe Google, there will be even more > > middleware that is called everytime. > > > > What is the best way to do this? The way Authentication backends works > > sounds like the perfect fit. > > You can specify middleware on a per-view basis by using > django.utils.decorators.decorator_from_middleware. > See the snippet at http://www.djangosnippets.org/snippets/1498/ for an > example using pyfacebook. > > -- > 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<django-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- 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.