Include Django URL patterns with decorators.
Find a file
2011-06-06 22:48:55 -07:00
src/decorator_include A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00
testproject A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00
.gitignore A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00
AUTHORS.rst A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00
bootstrap.py A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00
buildout.cfg A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00
README.rst Normalizing project name. 2011-06-06 22:48:55 -07:00
setup.py A working implementation of decorator_include. 2011-06-06 20:53:06 -07:00

django-decorator-include
========================

Include Django URL patterns with decorators.

Installation
------------

Installation from Source
````````````````````````

Unpack the archive, ``cd`` to the source directory, and run the following
command::

    python setup.py install

Installation with pip and git
`````````````````````````````

Assuming you have pip and git installed, run the following command to
install from the GitHub repository::

    pip install git+git://github.com/jeffkistler/django-decorator-include.git#egg=django-decorator-include

Usage
-----

``decorator_include`` is intended for use in URL confs as a replacement
for the ``django.conf.urls.defaults.include`` function. It works in almost
the same way as ``include``, however the first argument should be either a
decorator or an iterable of decorators to apply, in reverse order, to all
included views. Here is an example URL conf::

    from django.conf.urls.defaults import *
    from django.contrib.auth.decorators import login_required

    from decorator_include import decorator_include

    urlpatterns = patterns('',
        url(r'^$', 'mysite.views.index', name='index'),
        url(r'^secret/', decorator_include(login_required, 'mysite.secret.urls'),
    )