Registry /
auth-security / casbin-django-orm-adapter
Install & Compatibility
Where this runs
tested against v1.7.0 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 70.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.0s · import 0.000s · 71MB
70MB installed
● package 70MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Adapter
✓ from casbin_adapter import Adapter
✗ from casbin_django_orm_adapter.adapter import Adapter
Initialize Casbin enforcer with Django ORM adapter. Ensure Django is configured and settings module is set before use.
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'your_project.settings')
django.setup()
import casbin
from casbin_django_orm_adapter.adapter import Adapter
adapter = Adapter()
e = casbin.Enforcer('path/to/model.conf', adapter)
# Check permission
sub = 'alice'
obj = 'data1'
act = 'read'
if e.enforce(sub, obj, act):
print('Access granted')
else:
print('Access denied')
Upgrade
Version history
1.7.0latest on PyPI · released Aug 20, 2025
Audit
Dependencies
djangorequiredrequired for ORM functionality
casbinrequiredcore authorization library