django-urldecorators
Django-urldecorators is a reusable Django application which allows apply view decorators and middleware components depending on requested url.
Django-urldecorators is a reusable Django application which allows apply view decorators and middleware components depending on requested url. Installation and usage: 1) Run python setup.py install or add urldecorators directory to your PYTHONPATH 2) In urls.py file replace `from django.conf.urls.defaults import *` by `from urldecorators.defaults import *` 3) Pass list of decorators and/or middleware_classes 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']), ) Testing: # Setup testing enviroment (uses zc.buildout) cd test python bootstrap.py python bin/buildout-script.py # Run tests using miscellaneous Django versions bin/test-django-1.0 bin/test-django-1.1 bin/test-django-1.2 bin/test-django-1.3 bin/test-django-1.4 # Create database bin/manage-django-1.0 syncdb # Run server using miscellaneous Django versions bin/manage-django-1.0 runserver bin/manage-django-1.1 runserver bin/manage-django-1.2 runserver bin/manage-django-1.3 runserver bin/manage-django-1.4 runserverFilename | Platform | Type | Version | Uploaded On | Size |
---|---|---|---|---|---|
django-urldecorators-0.4.tar.gz | Source | 0.4 | 2012-05-29 13:54:42 | 5.9 KB |
- License:
- Author: Miloslav Pojman
- Home Page: http://github.com/mila/django-urldecorators/tree/master
- Download URL:
- Classifiers:
- Environment :: Web Environment
- Framework :: Django
- Intended Audience :: Developers
- License :: OSI Approved :: BSD License
- Operating System :: OS Independent
- Programming Language :: Python