django-colorfield is a simple color field for Django models, providing a user-friendly color-picker widget in the Django admin interface. It supports various color formats including HEX, HEXA, RGB, and RGBA. The library is actively maintained, with version 0.14.0 recently released, and typically sees updates for new Django and Python versions.
pip install django-colorfieldVerified import paths — ran on the pinned version, not inferred.
To quickly get started, install the package, add 'colorfield' to your `settings.INSTALLED_APPS`, and then define `ColorField`s in your Django models. After modifying `INSTALLED_APPS`, remember to run `python manage.py collectstatic` for the color picker to appear correctly in the admin. The `ColorField` automatically provides a color picker in the Django admin interface.
Review any custom JavaScript or CSS related to the color picker. Refer to the `coloris` documentation for its API and styling, and update your code accordingly.
Ensure your project runs on Python 3.8+ and Django 4.2+ (or newer compatible versions as per releases). Upgrade your Python and Django environments if necessary.
If you are upgrading from a version older than 0.10.1 and have existing `ColorField`s, ensure you run `makemigrations` and `migrate` after updating to reflect the new `max_length` in your database schema. Review any custom validation that assumes a `max_length` of 18.