--- id: django-bitfield version: "2.4.0" license: unclear license_treatment: unclear maintenance: active --- # django-bitfield — BitField in Django License: unclear · Maintenance: active · Downloads: 216.8K/mo ## What it is and what it does django-bitfield adds a BitField model field to Django that packs multiple boolean flags into a single database BigIntegerField (stored as BIGINT). Instead of creating separate boolean columns for each flag, you define them once in the field definition and then query and manipulate them using familiar Django ORM syntax—bitwise operations, filtering, and exclusion all work through the standard QuerySet API. The package includes admin integration via a checkbox widget and list filter, making it easy to manage flags in Django's admin interface. It's designed for PostgreSQL; SQLite and MySQL have significant limitations. The field stores flags efficiently and allows you to test, set, and clear individual flags or combinations of flags using intuitive Python syntax on model instances. Use it for: - Store user permissions or feature flags in a single database column instead of many boolean columns - Implement role-based access control where each role is a bit in a flags field - Track feature toggles or configuration states for A/B testing or gradual rollouts - Query models by multiple flag combinations efficiently using bitwise filtering - Manage admin UI for flag-based settings using the built-in checkbox widget ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a BitField model field for Django that stores multiple boolean flags in a single database BigIntegerField, enabling efficient flag-based queries and admin UI support. Yes, if you use PostgreSQL and need to store multiple boolean flags efficiently in Django models. The package is actively maintained, has no known vulnerabilities, and low install friction. However, verify the license before use and confirm PostgreSQL compatibility with your deployment. Not suitable for SQLite or MySQL projects. ## Install pip install django-bitfield uv add django-bitfield poetry add django-bitfield ## Installing django-bitfield Before you install: Low friction installation with a single dependency on Django. Actively maintained as of 2026-08-02 with recent Python 3.14 support added. Repository shows 383 stars and no archived status. License in practice: License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license before use in proprietary or restricted contexts. Quickstart: pip install django-bitfield from bitfield import BitField class MyModel(models.Model): flags = BitField(flags=('awesome_flag', 'flaggy_foo')) o = MyModel.objects.create(flags=0) if o.flags.awesome_flag: print('Flag is set') Requires PostgreSQL; SQLite does not support save operations using Bit, and MySQL fails on most BitField queries. Django >= 1.11 required. Verify before relying: - Exact Python version requirements (requires_python is unspecified in metadata) - Whether the package is compatible with the latest Django LTS versions - Performance characteristics when dealing with large numbers of flags ## Package facts - License: not declared (unclear) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 216.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django bitfield flags, django boolean flags database, django bigintegerfield flags, django admin checkbox flags, django bit operations model field, django-orm, database-optimization, flags-permissions [View on SkillFed](https://skillfed.io/packages/django-bitfield) · [View on PyPI](https://pypi.org/project/django-bitfield/)