This post originated from an RSS feed registered with Python Buzz
by Shabda Raaj.
Original Post: Understanding decorators
Feed Title: The Uswaretech Blog - Django/Python Web Development
Feed URL: http://feeds.feedburner.com/UswareBlog
Feed Description: Blog about building web applications using Django/Python/Jquery.
If you used Django for any length of time, you would have come across the
login_required decorator. You write @login_required before a view, and it
magically becomes accessible only to authenticated users.
Decorators were introduced in python 2.4. PEP 318
is the PEP describing it. At
the simplest decorators are nothing but callables returning other callables, and
the decorator syntax @decorator [...]
Related posts: