django-decorator-include
Include Django URL patterns with decorators
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-includeuv
uv add django-decorator-includepoetry
poetry add django-decorator-includeInstalling 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
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
django-bracesProvides reusable mixin classes for Django…
permissive · top 15,000 on PyPI
django-admin-extra-buttonsAdds custom buttons, links, and views to Django…
permissive · top 15,000 on PyPI
django-jinjaIntegrates Jinja2 templating into Django,…
permissive · top 15,000 on PyPI
django-robotsA Django application that manages robots.txt…
permissive · top 15,000 on PyPI
django-configurationsOrganizes Django settings using composable…
permissive · top 15,000 on PyPI
django-permissions-policySets the Permissions-Policy HTTP header on…
permissive · top 15,000 on PyPI
botoinatorBotoinator lets you attach decorators to boto3…
permissive · top 15,000 on PyPI
django-upgradeAutomatically modernizes Django project code by…
permissive · top 15,000 on PyPI
django-ninja-extraDjango Ninja Extra extends Django Ninja with…
permissive · top 15,000 on PyPI
google_apiProvides a Python wrapper for interacting with…
permissive · top 5,000 on PyPI