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.2.tar.gz
(28.8 kB
view details)
Built Distribution
File details
Details for the file django-colorfield-0.3.2.tar.gz
.
File metadata
- Download URL: django-colorfield-0.3.2.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5dde281f4db8871eb5845aee614b4f1a47e7fd5b20476238793f519cd7bdf41 |
|
MD5 | 9e348c16e3fda4c8ec30c078499c24c1 |
|
BLAKE2b-256 | f937be0357bfe6c05ed257aa4f71c6b9267fb592250486cb422e4975d6c34da1 |
File details
Details for the file django_colorfield-0.3.2-py2-none-any.whl
.
File metadata
- Download URL: django_colorfield-0.3.2-py2-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e435ec31712f5e8b955cc7633aef1e49cc3b409c21dfcefeb2f6ef0e1cb69533 |
|
MD5 | 9afe714dcd95d59ec7ad8f3f7994a2dd |
|
BLAKE2b-256 | 865be0c0a643ee1226cff59fe2d066028f993d679598c36aa95aa9cb09b0cbdd |