django-urldecorators 0.4

Apply view decorators and middleware components

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Miloslav Pojman
HOMEPAGE:
github.com
CATEGORY:
ROOT \ Internet \ HTTP (WWW)
django-urldecorators is a reusable Django plugin which allows you to apply view decorators and middleware components depending on requested URL.

Installation and usage:

1) Run python setup.py install or add urldecorators directory on your PYTHONPATH

2) In urls.py file replace 'from django.conf.urls.defaults import *' by 'from urldecorators.defaults import *'
  
 3) Pass list of decorators or middleware_classes to as argument to url function

Example urls.py file:

  from urldecorators.defaults import *
 
  urlpatterns = patterns('',                      
      url(r'^private/$', include('example.private.urls'),
          decorators=['django.contrib.auth.decorators.login_required']),
      url(r'^articles/$', include('example.articles.urls'),
          middleware_classes=['django.middleware.cache.CacheMiddleware']),
  )

Last updated on August 20th, 2012

requirements

#view decorators #middleware components #URL decorators #Django #URL #decorators #middleware

Add your review!

SUBMIT