On 29-04-12 21:24, knowledge_seeker wrote:
On Friday, April 27, 2012 7:09:32 PM UTC-7, knowledge_seeker wrote:

    My Django book (from the university library) said to add the label
    "@login_required" to views that I wish to restrict user access on.
    Django 1.4 does not allow this; obviously the book is dated! Is there
    a more modern way to get the same effect?

Perhaps your @login_required error was also an forgot-to-import-it error. But it also might be because you're using a class based view.

If so, look for the 'decorators' heading in the following link:
http://www.caktusgroup.com/blog/2011/12/29/class-based-views-django-13/

You need to decorate the dispatch() method in the class-based-view case.


Reinout

--
Reinout van Rees                    http://reinout.vanrees.org/
rein...@vanrees.org             http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to