django - How to check if user is authenticated for entire url include -
i have following url statement in urls.py
url(r'^search/', include('haystack.urls')),
now want users access url if authenticated, otherwise request should redirected url '/accounts/login/'
i know need use logic this, not sure how done urls included other packages?
if request.user.is_authenticated(): # authenticated users. else: # anonymous users.
Comments
Post a Comment