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):
.
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 render_to_r
2 matches
Mail list logo