simple color field for your models with a nice color-picker in the admin-interface.
Project description
django-colorfield
simple color field for your models with a nice color-picker in the admin-interface.
Installation
- Run
pip install django-colorfield
- Add
colorfield
tosettings.INSTALLED_APPS
- Run
python manage.py collectstatic
- Restart your application server
Usage
Settings
This package doesn't need any setting.
Models
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')
Admin
The admin will kindly provide a simple color picker for all color fields. :)
Testing
# 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"
Credits
Originally developed by Jared Forsyth
License
Released under MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-colorfield-0.3.1.tar.gz
(28.9 kB
view hashes)
Built Distribution
Close
Hashes for django_colorfield-0.3.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5830fcc4b1ab3111e2e6c8a2d75e25c09e404cea80d9f50002b09f068c8854df |
|
MD5 | a973872371aad14969daea3f24e2e942 |
|
BLAKE2b-256 | 059bee32c060873df1995289b67264424f9950b363c1a04863cc5c427de1cd97 |