Sunday, April 29, 2012

Re: outdated django book

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:

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


Reinout van Rees
"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
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment