Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Python
  3. django-guardian

django-guardian

NOASSERTIONPython3.4.1

Adds per-object permissions to Django's authorization system, enabling fine-grained access control.

Visit WebsiteGitHubGitHub
3.9k stars595 forks0 contributors

What is django-guardian?

django-guardian is a Django package that implements per-object permissions, extending Django's standard model-level permissions to allow fine-grained access control on individual database objects. It solves the problem of needing to restrict user actions on specific instances, such as allowing a user to edit only their own blog posts.

Target Audience

Django developers building applications that require complex, instance-level access control, such as multi-tenant systems, content management platforms, or enterprise software.

Value Proposition

Developers choose django-guardian because it integrates seamlessly with Django's existing permission system, is well-documented, widely used in production, and provides a straightforward API for managing object-level permissions without reinventing the wheel.

Overview

Per object permissions for Django

Use Cases

Best For

  • Implementing fine-grained access control in multi-tenant Django applications
  • Building CMS platforms where users need permissions on specific content items
  • Creating enterprise software with complex user roles and object-level security
  • Extending Django admin to manage permissions on individual model instances
  • Developing applications where users should only access or modify their own data

Not Ideal For

  • Applications that only require global or role-based permissions without object-level granularity
  • Projects using GraphQL or REST APIs with custom permission logic that doesn't integrate with Django's ORM
  • Teams prioritizing minimal database overhead in high-traffic, permission-heavy systems
  • Systems needing hierarchical or attribute-based access control beyond flat per-object permissions

Pros & Cons

Pros

Granular Access Control

Enables per-object permissions on individual model instances, as shown in the README with examples like assigning 'change_group' to specific users, solving complex access needs beyond Django's default model-level permissions.

Seamless Admin Integration

Provides GuardedModelAdmin to manage object permissions directly in Django admin, replacing admin.ModelAdmin easily, which simplifies administrative workflows for permission management.

Modern UI Compatibility

Integrates out-of-the-box with django-unfold for a modern admin interface, as noted in the README, ensuring better user experience without extra configuration.

Strong Documentation & Community

Offers comprehensive online documentation and is used by thousands of projects worldwide, indicating reliability and good support, with high test coverage (97.8%) ensuring stability.

Cons

Database Performance Overhead

Checking permissions on individual objects requires additional database queries, which can slow down applications with many permission checks, especially in large-scale systems.

Setup Intrusiveness

Requires modifying Django's AUTHENTICATION_BACKENDS and INSTALLED_APPS, which might conflict with custom backends or existing authentication setups, adding complexity to project configuration.

Limited to Django ORM

Tightly coupled with Django's ORM, making it less suitable for applications using raw SQL, non-relational databases, or alternative data access layers without Django models.

Frequently Asked Questions

Quick Stats

Stars3,912
Forks595
Contributors0
Open Issues25
Last commit5 days ago
CreatedSince 2010

Tags

#authentication#authorization#security#python#access-control#web-framework#backend#permissions#django

Built With

D
Django
P
Python

Links & Resources

Website

Included in

Python290.8k
Auto-fetched 8 hours ago

Related Projects

django-allauthdjango-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication. 🔁 Mirror of https://codeberg.org/allauth/django-allauth/

Stars10,376
Forks3,110
Last commit6 days ago
pyjwtpyjwt

JSON Web Token implementation in Python

Stars5,697
Forks795
Last commit15 hours ago
authlibauthlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS, JWE, JWK, JWA, JWT included.

Stars5,414
Forks562
Last commit8 days ago
django-oauth-toolkitdjango-oauth-toolkit

OAuth2 goodies for the Djangonauts!

Stars3,335
Forks857
Last commit6 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub