Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-material-icon-widget

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-material-icon-widget

Icon Picker for admin panel In Django

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

Django Material Icon Picker Widget

How to start:

pip install django-material-icons

Include it in the settings (Installed apps):

INSTALLED_APPS = [
    ...
    'django.contrib.staticfiles',
    'icon_picker_widget', #<---- 
    ...

Add static path files of widget to settings.py:

STATICFILES_DIRS = [
    ('icon_picker_widget',os.path.join(BASE_DIR, 'icon_picker_widget/static'))
]

Example of Usage:

model.py:

from django.db import models

class BlogPost(models.Model):
    name = models.TextField()
    icon = models.TextField()

admin.py

from django import forms
from django.contrib import admin
from icon_picker_widget.widgets import IconPickerWidget
from .models import BlogPost

class BlogPostAdminForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(BlogPostAdminForm, self).__init__(*args, **kwargs)
        self.fields['icon'].widget = IconPickerWidget()

class BlogPostAdmin(admin.ModelAdmin):
    form = BlogPostAdminForm

admin.site.register(BlogPost, BlogPostAdmin)

Acknowledgements

This widget wraps npick, a no-frills, no-fuss javascript icon picker.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc