Login Required Middleware

2012-07-30 Thread Blaxton
Hi I am trying to use login required middleware in a project and followed every step mentioned on following url , but its just not working. http://djangosnippets.org/snippets/1179/ placed the above middleware in myproject/middleware.py added following lines to settings.py LOGIN_URL

AW: login-required

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
(1) 534 52 - 146 -Ursprüngliche Nachricht- Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Martin Melin Gesendet: Montag, 14. Februar 2011 09:45 An: django-users@googlegroups.com Betreff: Re: login-required On Mon, Feb 14, 2011 at 9:40 AM, Szabo

Re: login-required

2011-02-14 Thread Martin Melin
On Mon, Feb 14, 2011 at 9:40 AM, Szabo, Patrick (LNG-VIE) wrote: > Hi, > > I've tried using the @login_required decorator to limit acces to a > certain view. > This worked fine. > Unfortunately in the template that you are redirected to if the login > was succesfull I

login-required

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Hi, I've tried using the @login_required decorator to limit acces to a certain view. This worked fine. Unfortunately in the template that you are redirected to if the login was succesfull I don't have acces to any information like username oder alike. How do I realize that ?! For the login

Re: login required

2009-09-09 Thread Jeff Green
I would think you could just extend the User model to store the registered users and then check if the user is registered which would then redirect to the survey page. On Tue, Sep 8, 2009 at 11:30 PM, putih wrote: > > hii, > > need your help on this matter :- > > 1.

Re: login required

2009-09-08 Thread putih
ok thanks .. i have use this tutorial but i a lot of errors comes in.. mayb need to understand for python code first. btw, thanks again On Sep 9, 1:08 am, "ristretto.rb" wrote: > Have you not had a peek in here yet? > >

Re: login required

2009-09-08 Thread ristretto.rb
Have you not had a peek in here yet? http://docs.djangoproject.com/en/dev/topics/auth/#topics-auth gene On Sep 9, 4:30 pm, putih wrote: > hii, > > need your help on this matter :- > > 1. how to restrict user for certain page. for example :- > > non-register user

login required

2009-09-08 Thread putih
hii, need your help on this matter :- 1. how to restrict user for certain page. for example :- non-register user have to register first before they can join a survey. after register, they login and redirect to the survey page. (not main page.) anyone, please advise me on this problem.

Re: Testing login required views

2008-05-21 Thread Adam Gomaa
On Tue, May 20, 2008 at 9:19 PM, Julien <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a site where pretty much all views (except for register, login > and logout) require the user to log in. Now that the number of views > has grown I'd like to test that I didn't forget to protect them with > the

Re: Testing login required views

2008-05-20 Thread Julien
In another thread [1] James Bennett suggested to use a middleware to require login for all views. That is indeed a very simple and elegant way. Here's the code I ended up with: from django.contrib.auth.decorators import login_required from django.conf import settings public_paths =

Testing login required views

2008-05-20 Thread Julien
Hi, I have a site where pretty much all views (except for register, login and logout) require the user to log in. Now that the number of views has grown I'd like to test that I didn't forget to protect them with the login_required decorator. I'm looking for an automated way to do that. Is that

Re: setting up login required pages massly

2007-07-19 Thread Nathan Ostgard
You can define a custom decorator instead, specifying a custom login_url: from django.contrib.auth.decorators import user_passes_test my_login_decorator = user_passes_test(lambda u: u.is_authenticated(), login_url='/my/login/url') Then you can use: @my_login_decorator def someview(request):

setting up login required pages massly

2007-07-19 Thread james_027
hi, is there a stupidly fast way to make select but many pages to required login first? I am using 0.96 @login_required is cool, but 0.96 doesn't support LOGIN_URL in the settings.py yet. currently i am using something like this if not request.user.is_authenticated(): return