djangocms-attributes-field
Adds attributes to Django models.
Decision gist · record as of 2026-08-14
Yes. This package is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a real problem for Django projects that need flexible HTML attributes. The low install friction and single dependency on django-cms make it a straightforward addition to Django CMS sites. Use it when you need to store arbitrary attributes without schema bloat.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires django-cms as a runtime dependency and Python 3.9 or later.
- Low install friction with a single runtime dependency on django-cms.
- The package is actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is a permissive license; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
last release 2025-11-02 (285 days) · last repo commit 2026-04-14 · 28 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 82,253 downloads/mo, #14,174 on PyPI
Alternatives
Verify before relying
pip install djangocms-attributes-field
# In models.py
from djangocms_attributes_field.fields import AttributesField
class MyCoolModel(models.Model):
attributes = AttributesField()
# In template
<div {{ object.attributes_str }}>click me</div>- Performance characteristics when storing large numbers of attributes or very large attribute values in a single field.
- Specific Django and Django CMS version compatibility beyond the classifiers listed (4.2, 5.0, 5.1, 5.2 for Django; 3.11, 4.1, 5.0 for Django CMS).
What it is and what it does
This package provides an opinionated JSONField implementation for Django models that need to store arbitrary HTML element attributes without creating separate database columns or related tables for each attribute type. It solves the problem of managing flexible, schema-less attributes like data-* attributes or custom HTML properties that would otherwise require either many individual model fields or complex relational structures.
The package includes an AttributesField that stores key-value pairs as JSON and an AttributesWidget that provides an intuitive admin interface for editing these pairs. It automatically excludes dangerous keys like 'src', 'href', 'data', 'action', and any key starting with 'on' to prevent unintended JavaScript execution. The field also provides a convenience property that renders stored attributes as an HTML-safe string ready for template inclusion.
Use it for
- Store custom data-* attributes on Django model instances without creating separate fields for each attribute type.
- Manage flexible HTML element attributes in a Django CMS plugin or page extension without schema migration overhead.
- Build admin forms where content editors can add arbitrary key-value pairs to HTML elements with a user-friendly widget interface.
- Avoid performance problems from excessive database columns or join tables when a model needs to support many optional attributes.
- Render HTML elements with dynamic attributes in templates by using the field's _str property for safe, escaped output.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This package is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a real problem for Django projects that need flexible HTML attributes. The low install friction and single dependency on django-cms make it a straightforward addition to Django CMS sites. Use it when you need to store arbitrary attributes without schema bloat.
Install
djangocms-attributes-field on PyPI
Before you install
Low install friction with a single runtime dependency on django-cms. The package is actively maintained with a recent release and no known vulnerabilities.
Requires django-cms as a runtime dependency and Python 3.9 or later.
License in practice
BSD-3-Clause is a permissive license; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
pip install djangocms-attributes-field
# In models.py
from djangocms_attributes_field.fields import AttributesField
class MyCoolModel(models.Model):
attributes = AttributesField()
# In template
<div {{ object.attributes_str }}>click me</div>
Verify before relying
- Performance characteristics when storing large numbers of attributes or very large attribute values in a single field.
- Specific Django and Django CMS version compatibility beyond the classifiers listed (4.2, 5.0, 5.1, 5.2 for Django; 3.11, 4.1, 5.0 for Django CMS).
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedjango-cms |
| Maintenance | Actively maintained 285 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,253 / month, #14,174 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django CMSFramework :: Django CMS :: 3.11Framework :: Django CMS :: 4.1Framework :: Django CMS :: 5.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software DevelopmentTopic :: Software Development :: Libraries |
Evidence: djangocms_attributes_field-4.1.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django html attributes field”
- djangocms-attributes-fieldProvides a Django model field and widget for storing and managing…
- django-widget-tweaksCustomize Django form field HTML and CSS in templates using template…
- django-bleachIntegrates bleach HTML sanitization into Django models, forms, and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also django-cms · django-json-widget · djangocms-text-ckeditor · django-multiselectfield · djangocms-admin-style · jsonfield · django-js-asset · django-multi-email-field · contentstack-utils · django-filer