Registry / web-framework / django-decorator-include

django-decorator-include

JSON →
library3.3pypypi✓ verified 90d ago

Include Django URL patterns with decorators. Version 3.3, supports Django 3.0+ and Python >=3.6. Release cadence is low (stable, maintained).

pip install django-decorator-include
INSTALL
IMPORT
SIG · DJANGO-DECORATOR-I
D
django-decorator-include
web-frameworkpythonv3.3
Install
4.3s avg
Import
662ms
Disk
66MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.696s · 67.7MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.3s · import 0.628s · 68MB
66MB installed
● package 66MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

decorator_include
✓ from decorator_include import decorator_include
✗ from django_decorator_include import decorator_include
Wrong because the package is installed as decorator_include, not django_decorator_include.

Include a set of URL patterns wrapped with a decorator (e.g., login_required).

from django.urls import path, include from django.contrib.auth.decorators import login_required from decorator_include import decorator_include urlpatterns = [ path('private/', decorator_include(login_required, include('private_app.urls'))), ]
Debug
Known issues
gotchaThe decorator is applied to each view function in the included URL patterns, not to the path itself. Ensure decorators are callable and compatible with the view signatures.
fix
Use a decorator that works on view functions, e.g., login_required, not a middleware.
affects: all
deprecatedDjango 3.0+ required; older Django versions (2.x) are not supported from version 3.0 of this library.
fix
Upgrade Django to >=3.0 or use django-decorator-include <3.0.
affects: >=3.0
breakingIn version 3.0, the import path changed from `django_decorator_include` to `decorator_include`.
fix
Change `from django_decorator_include import decorator_include` to `from decorator_include import decorator_include`.
affects: >=3.0
Errors
Common errors & fixes
ImportError: No module named 'django_decorator_include'
Using the old import path after upgrading to v3.0+.
fix
Use `from decorator_include import decorator_include` instead.
TypeError: decorator_include() got multiple values for argument 'view'
Passing a URL pattern directly without wrapping in `include()`.
fix
Use `decorator_include(decorator, include('app.urls'))` rather than `decorator_include(decorator, path(...))`.
Upgrade
Version history
3.3latest on PyPI · released Jan 16, 2025
Audit
Dependencies
DjangorequiredMajor dependency for URL routing
Agent activity
5 hits · last 30 days
node
4
Resources
django-decorator-include — pip install django-decorator-include · libregistry