simple color field for your models with a nice color-picker in the admin-interface.
- Run
pip install django-colorfield
- Add
colorfield
tosettings.INSTALLED_APPS
- Run
python manage.py collectstatic
- Restart your application server
This package doesn't need any setting.
Just add color field(s) to your models like this:
from colorfield.fields import ColorField
from django.db import models
class MyModel(model.Model):
color = ColorField(default='#FF0000')
The admin will kindly provide a simple color picker for all color fields. :)
# create python 3.8 virtual environment
virtualenv testing_django_colorfield -p "python3.8" --no-site-packages
# activate virtualenv
cd testing_django_colorfield && . bin/activate
# clone repo
git clone https://github.com/fabiocaccamo/django-colorfield.git src && cd src
# install dev requirements
pip install tox
# run tests
tox
# or
python setup.py test
# or
python manage.py test --settings "tests.settings"
Originally developed by Jared Forsyth
Released under MIT License.