How to use HTML5 color picker in Django admin
<p>I'm trying to implement the HTML5 colorpicker in Django's admin page.</p>

<p>Here is my model:</p>

<pre><code>#model.py
...

class Category(models.Model):
    ...
    color = models.CharField(max_length=7)
</code></pre>

<p>Here is the form:</p>

<pre><code>#form.py
from django.forms import ModelForm
from django.forms.widgets import TextInput
from .models import Category

class CategoryForm(ModelForm):
    class Meta:
        model = Category
        fields = '__all__'
        widgets = {
            'color': TextInput(attrs={'type': 'color'}),
        }

class CategoryAdminForm(ModelForm):
    form = CategoryForm
</code></pre>

<p>And finally the admin:</p>

<pre><code>#admin.py
...
from .forms import CategoryAdminForm

...
class CategoryAdmin(admin.ModelAdmin):
    form_class = CategoryAdminForm
    filter_horizontal = ('questions',)
    fieldsets = (
        (None, {
            'fields': (('name', 'letter'), 'questions', 'color')
            }),
        )
</code></pre>

<p>However, the type for the field is still text. How do I change the type for the input field to color in the admin page?</p>