skillfed

django-decorator-include

Include Django URL patterns with decorators

django-decorator-include v3.5 189.5K downloads/30d#9,928 on PyPI81
Permissive license BSD-2-Clause Active released

What it is and what it does

django-decorator-include is a utility that extends Django's URL routing to apply decorators to entire included URL configurations at once. Instead of decorating individual views, you pass one or more decorators alongside the URL module you want to include, and all views in that module inherit those decorators in the order you specify.

It's useful when you have a set of related views that all need the same protection or behavior—such as a login requirement or permission check—without decorating each view individually. The package depends only on Django and importlib_metadata, has no known vulnerabilities, and supports Django versions from 2.2 through 6.1.

Use it for:

  • Protect an entire section of your site by wrapping its URL include with login_required and permission decorators.
  • Apply custom authentication logic to a group of endpoints without repeating the decorator on every view.
  • Enforce role-based access control on a module of views by stacking multiple permission-check decorators in one include.
  • Add request logging or rate-limiting to a subsection of your URL configuration by including it with a custom decorator.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Applies decorators to Django URL patterns included from other modules, letting you wrap entire URL configurations with authentication, permission checks, or other logic.

Yes. This is a lightweight, actively maintained utility that solves a real Django routing problem with no security vulnerabilities, permissive licensing, and low install friction. Use it when you have groups of views that need the same decorator logic.

Install

django-decorator-include on PyPI

pip

pip install django-decorator-include

uv

uv add django-decorator-include

poetry

poetry add django-decorator-include

Installing django-decorator-include

Before you install

Installs with minimal friction—only Django and importlib_metadata as runtime dependencies. Actively maintained with a recent release; repository shows steady activity.

License in practice

BSD-2-Clause is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.

Quickstart

pip install django-decorator-include

from django.urls import path
from django.contrib.auth.decorators import login_required

urlpatterns = [
    path('secret/', include_with_decorators(login_required, 'myapp.urls')),
]

Verify before relying

  • Whether the package works with all listed Django versions (2.2 through 6.1) without additional setup or configuration.

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 2 — Django, importlib_metadata
Maintenance actively maintained — 52 days since the last release
Last repo commit
First released
Downloads 189,472/month — #9,928 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_decorator_include-3.5-py3-none-any.whl

Keywords: django, urls

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 2.2Framework :: Django :: 3.0Framework :: Django :: 3.1Framework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Framework :: Django :: 6.1Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP

Tags

django url decoratorsapply decorators to django urlsdjango url pattern wrappingdjango include with decoratorsdjango view decorators bulk apply
django-urlsdecorators

More WWW/HTTP packages