Skip to main content

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.

django-colorfield

Installation

  • Run pip install django-colorfield
  • Add colorfield to settings.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


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.2.1.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

django_colorfield-0.2.1-py2-none-any.whl (28.6 kB view details)

Uploaded Python 2

File details

Details for the file django-colorfield-0.2.1.tar.gz.

File metadata

  • Download URL: django-colorfield-0.2.1.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3

File hashes

Hashes for django-colorfield-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2a20722384a1703ff9b91a395de6e2649a8786161f8baff4d21998ba839f9017
MD5 122cbb75f5737dab9b47c105ceacb754
BLAKE2b-256 725038f6d62f049e904cc928606fc262ab676bea915236504ec8348198d8de11

See more details on using hashes here.

File details

Details for the file django_colorfield-0.2.1-py2-none-any.whl.

File metadata

  • Download URL: django_colorfield-0.2.1-py2-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.3

File hashes

Hashes for django_colorfield-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 c22c9cdae8608432adcde09d6e9e05dd4c498207e1cda0ab8fba0ab3ceb85dcd
MD5 7c6bd049f70fe640fcbb2979eb701ec6
BLAKE2b-256 0b65748148aa16936856d689bfd937fcda93e4721c95c57eb2c1be6540322c04

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page