On Monday, 1 December 2014 23:59:00 UTC, Rootz wrote:
>
> I have a small project but I am trying to restrict access on some of the 
> django app urls to login users only. The problem is that when I hit a page 
> that requires login users I expected that they(users) are redirected to the 
> login page however that is not the case of what happens instead they are 
> redirected to an example url link like this '/login?next=/detail/1/' with 
> an error message as stated "TypeError at /login/ object() takes no 
> parameters" 
>
> The django project url
>
>
> (r'^detail/(?P<pk>\d{1,10})/$',login_required(views.DetailViewMember.as_view)),
>
>  
This has nothing to do with the decorator. You need to *call* the as_view 
method:
  
(r'^detail/(?P<pk>\d{1,10})/$',login_required(views.
DetailViewMember.as_view())),
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20cae352-c3a8-4c8c-9296-00f735c2c82e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to