{"id":25072483,"url":"https://github.com/bixat/django_icon_picker","last_synced_at":"2025-09-08T14:43:40.134Z","repository":{"id":228888086,"uuid":"775087360","full_name":"bixat/django_icon_picker","owner":"bixat","description":"A custom Django model field that allows users to select icons from a predefined set.","archived":false,"fork":false,"pushed_at":"2025-06-10T18:16:08.000Z","size":528,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T19:44:46.618Z","etag":null,"topics":["django","font-awesome","icon-pick","iconify","icons","material-icons"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-icon-picker/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bixat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-20T18:29:08.000Z","updated_at":"2025-06-10T18:16:12.000Z","dependencies_parsed_at":"2025-01-16T10:29:25.971Z","dependency_job_id":"58b5e9e6-324f-4d0d-b11b-1c7e10093705","html_url":"https://github.com/bixat/django_icon_picker","commit_stats":null,"previous_names":["m97chahboun/django_icon_picker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bixat/django_icon_picker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bixat%2Fdjango_icon_picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bixat%2Fdjango_icon_picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bixat%2Fdjango_icon_picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bixat%2Fdjango_icon_picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bixat","download_url":"https://codeload.github.com/bixat/django_icon_picker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bixat%2Fdjango_icon_picker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274201308,"owners_count":25240256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","font-awesome","icon-pick","iconify","icons","material-icons"],"created_at":"2025-02-06T22:29:31.649Z","updated_at":"2025-09-08T14:43:40.111Z","avatar_url":"https://github.com/bixat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Django Icon Picker\n\n## Overview\n\nDjango Icon Picker is a custom Django model field that allows users to select icons from a predefined set. It supports both SVG icons and icon IDs, depending on the configuration.\n\n## Features\n\n- **SVG File Support**: If the `ICON_PICKER_PATH` is defined in your Django settings, the Icon Picker will download the selected SVG file and save it to the specified path. The path to the saved SVG file will be stored in the `icon` field of the form.\n- **Icon ID Support**: If the `ICON_PICKER_PATH` is not defined, the Icon Picker will store the ID of the selected icon in the `icon` field.\n- **Easy Integration**: Use the `IconPicker` widget as a model field widget in your Django forms.\n\n## Screenshot\n\n![Django Icon Picker Demo](icon_picker.gif)\n\n## Installation \u0026 Usage\n\n### Step 1: Install Django Icon Picker\n\nFirst, ensure you have Django Icon Picker installed in your project. If not, you can install it using pip:\n\n```bash\npip install django-icon-picker\n```\n\nAdd `django_icon_picker` to `INSTALLED_APPS`:\n\n```python\n# settings.py\nINSTALLED_APPS = [\n    # Other installed apps...\n    'django_icon_picker',\n]\n```\n\nUpdate `urls.py` (required for SVG file download functionality):\n\n```python\nfrom django.contrib import admin\nfrom django.urls import path, include\nfrom django.conf import settings\nfrom django.conf.urls.static import static\n\nurlpatterns = [\n    path(\"admin/\", admin.site.urls),\n    path(\"icon_picker/\", include(\"django_icon_picker.urls\")),\n]\n\nif settings.DEBUG:\n    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n```\n\n### Step 2: Configure Django Settings\n\nIf you want to use SVG files, define the `ICON_PICKER_PATH` in your Django settings. This is the path where the SVG files will be saved.\n\n```python\n# settings.py\nICON_PICKER_PATH = 'media'\n\n# Default icon color\nICON_PICKER_COLOR = \"#00bcc9\"\n```\n\n### Step 3: Use IconField in your model\n\n```python\nfrom django.db import models\nfrom django_icon_picker.field import IconField\nfrom django.utils.html import format_html\n\nclass ExampleModel(models.Model):\n    icon = IconField(max_length=255)\n    name = models.CharField(max_length=255)\n\n    def svg_icon(self):\n        return format_html(\n            '\u003cimg src=\"{}\" height=\"30\" width=\"30\" alt=\"{}\"/\u003e'.format(\n                f\"/{self.icon}\"\n                if self.icon.endswith(\".svg\")\n                else f\"https://api.iconify.design/{self.icon}.svg\",\n                f\"Icon for {self.name}\"\n            )\n        )\n\n    def __str__(self):\n        return self.name\n```\n\n## Configuration Options\n\n| Setting | Default | Description |\n|---------|---------|-------------|\n| `ICON_PICKER_PATH` | `None` | Path where SVG files will be saved. If not defined, only icon IDs are stored. |\n| `ICON_PICKER_COLOR` | `\"#00bcc9\"` | Default color for icons |\n\n## Requirements\n\n- Django \u003e= 3.0\n- Python \u003e= 3.6\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Conclusion\n\nDjango Icon Picker provides a simple and effective way to include icon selection functionality in your Django forms. Whether you need to work with SVG files or icon IDs, this widget has you covered.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbixat%2Fdjango_icon_picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbixat%2Fdjango_icon_picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbixat%2Fdjango_icon_picker/lists"}