Thanks I got it to work...
On Tuesday, December 2, 2014 7:22:30 AM UTC-5, Daniel Roseman wrote:
-- On Tuesday, December 2, 2014 7:22:30 AM UTC-5, Daniel Roseman wrote:
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+unsubscribe@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/ff9b6f8d-9776-4196-a500-86ef533383bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment