{"id":13465701,"url":"https://github.com/inventare/django-image-uploader-widget","last_synced_at":"2025-03-25T16:32:42.800Z","repository":{"id":41769470,"uuid":"374257556","full_name":"inventare/django-image-uploader-widget","owner":"inventare","description":"A beautiful image uploader widget for django and django-admin","archived":false,"fork":false,"pushed_at":"2024-12-23T10:57:22.000Z","size":15671,"stargazers_count":53,"open_issues_count":7,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-23T11:34:00.518Z","etag":null,"topics":["django","django-admin","image","inline-editing","python","typescript","uploader","widget"],"latest_commit_sha":null,"homepage":"https://inventare.github.io/django-image-uploader-widget/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inventare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-06-06T03:17:28.000Z","updated_at":"2024-12-04T11:42:24.000Z","dependencies_parsed_at":"2024-01-09T19:00:41.993Z","dependency_job_id":"35742b5d-ed3e-4237-a391-ca2b1e8c3845","html_url":"https://github.com/inventare/django-image-uploader-widget","commit_stats":{"total_commits":194,"total_committers":2,"mean_commits":97.0,"dds":0.08762886597938147,"last_synced_commit":"a4f6a43811ca67eb589d8ec9e393734a74a3fa8e"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventare%2Fdjango-image-uploader-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventare%2Fdjango-image-uploader-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventare%2Fdjango-image-uploader-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inventare%2Fdjango-image-uploader-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inventare","download_url":"https://codeload.github.com/inventare/django-image-uploader-widget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245500453,"owners_count":20625583,"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","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","django-admin","image","inline-editing","python","typescript","uploader","widget"],"created_at":"2024-07-31T15:00:34.010Z","updated_at":"2025-03-25T16:32:42.035Z","avatar_url":"https://github.com/inventare.png","language":"Python","funding_links":[],"categories":["Packages to install at your project"],"sub_categories":["Widgets / Fields"],"readme":"\u003ch1 align=\"center\"\u003edjango-image-uploader-widget\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/behaviour_inline.gif\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Supported Python Versions\" src=\"https://img.shields.io/badge/Python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue\" /\u003e\n    \u003cimg alt=\"Supported Django Versions\" src=\"https://img.shields.io/badge/Django-4.2%20|%205.0%20|%205.1-blue\" /\u003e\n    \u003cimg alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/django-image-uploader-widget\" /\u003e\n    \u003cimg alt=\"GitHub License\" src=\"https://img.shields.io/github/license/inventare/django-image-uploader-widget\" /\u003e\n    \u003cimg alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dm/django-image-uploader-widget\" /\u003e\n    \u003cimg alt=\"GitHub Actions Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/inventare/django-image-uploader-widget/test.yml?label=tests\" /\u003e\n\u003c/p\u003e\n\n## Introduction\n\n`django-image-uploader-widget` provides a beautiful image uploader widget for **django** and a multiple image inline editor for **django-admin**.\n\n## Requirements\n\n- Python 3.8+\n- Django 4.2+\n- Django 3.2,4.0,4.1 (uses `django-image-uploader-widget\u003c=0.7.1`)\n\n## Features\n\n- [x] Support required and optional `ImageField`;\n- [x] Support for `ImageField` inside inlines **django-admin**;\n- [x] Support preview modal;\n- [x] Support custom inline for **django-admin** usage.\n- [x] Support reordering inside **django-admin** inline.\n- [x] Support `ArrayField` for `PostgreSQL` databases.\n- [x] Support upload by dropping file.\n- [x] Out of box HTMX support.\n\n## Installation\n\nInstall from PyPI:\n\n```bash\npip install django-image-uploader-widget\n```\n\n\u003e\n\u003e On the `1.0.0` release of this package we droped the support for `Django 3.2`, `Django 4.0` and `Django 4.1`. We, currently, maintain the support for `Django 4.2` (LTS), `Django 5.0` and `Django 5.1`. Then, if you are using `Django 3.2`, `4.0` or `4.1`, installs `0.7.1` version:\n\u003e\n\u003e ```bash\n\u003e pip install django-image-uploader-widget==0.7.1\n\u003e ```\n\u003e\n\nAdd `image_uploader_widget` to `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = [\n    # ...\n    'image_uploader_widget',\n    # ...\n]\n```\n\n## Basic Usage\n\n### With Admin\n\nThe `ImageUploaderWidget` is a class that implements a custom widget for single image uploader and can be used inside the `formfield_overrides` attribute inside the `ModelAdmin` class.\n\n```python\n# admin.py\nfrom django.contrib import admin\nfrom django.db import models\nfrom image_uploader_widget.widgets import ImageUploaderWidget\nfrom .models import YourModel\n\n\n@admin.register(YourModel)\nclass YourModelAdmin(admin.ModelAdmin):\n    formfield_overrides = {\n        models.ImageField: {'widget': ImageUploaderWidget},\n    }\n```\n\nSee the [documentation](https://inventare.github.io/django-image-uploader-widget/widget/resumed/) for more complex usage's.\n\n### With ModelForm\n\nThe `ImageUploaderWidget` can be used inside the `widgets` Meta attribute of a `Form`/`ModelForm`:\n\n```python\n# forms.py\nfrom django import forms\nfrom image_uploader_widget.widgets import ImageUploaderWidget\n\nclass ExampleForm(forms.ModelForm):\n    class Meta:\n        widgets = {\n            'image': ImageUploaderWidget(),\n        }\n        fields = '__all__'\n```\n\nSee the [documentation](https://inventare.github.io/django-image-uploader-widget/widget/resumed/) for more complex usage's.\n\n### Custom Inline Admin\n\nThe `ImageUploaderInline` is implemented with the base of the `admin.StackedInline` to create an custom **django-admin** to work with multiple images upload using a model only to store the images:\n\n```python\n# models.py\n\nclass Product(models.Model):\n    # ...\n\nclass ProductImage(models.Model):\n    product = models.ForeignKey(\n        Product,\n        related_name=\"images\",\n        on_delete=models.CASCADE\n    )\n    image = models.ImageField(\"image\")\n    # ...\n```\n\n```python\n# admin.py\nfrom django.contrib import admin\nfrom image_uploader_widget.admin import ImageUploaderInline\nfrom .models import Product, ProductImage\n\nclass ProductImageAdmin(ImageUploaderInline):\n    model = ProductImage\n\n@admin.register(Product)\nclass ProductAdmin(admin.ModelAdmin):\n    inlines = [ProductImageAdmin]\n```\n\nSee the [documentation](https://inventare.github.io/django-image-uploader-widget/inline_admin/tutorial/) for more complex usage's.\n\n### Array Field\n\nThe ArrayField support is made by a custom field, called `ImageListField`. Then, to use it, we need to change the field from default `ArrayField` to `ImageListField`. The reason for it is: the default `ArrayField` with `ImageField` not works and some part of the behaviour of the `ImageField` is implemented inside the `ImageListField`.\n\n```python\n# models.py\nfrom django.db import models\nfrom image_uploader_widget.postgres import ImageListField\n\nclass TestWithArrayField(models.Model):\n    images = ImageListField(blank=True, null=True, upload_to=\"admin_test\")\n\n    class Meta:\n        verbose_name = \"Test With Array Field\"\n```\n\nSee the [documentation](https://inventare.github.io/django-image-uploader-widget/array_field/tutorial/) for more complex usage's.\n\n## Documentation\n\nAll the documentation of basic and advanced usage of this package is disponible at [documentation](https://inventare.github.io/django-image-uploader-widget/).\n\n## Preview\n\n![Widget with Image in Dark Theme](https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/widget_image_dark.png#gh-dark-mode-only)![Widget with Image in Light Theme](https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/widget_image.png#gh-light-mode-only)\n\n![Widget in Dark Theme](https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/widget_dark.png#gh-dark-mode-only)![Widget in Light Theme](https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/widget.png#gh-light-mode-only)\n\n## Behaviour\n\n![Widget Behaviour](https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/behaviour_widget.gif)\n\n![Custom Admin Inline Behaviour](https://raw.githubusercontent.com/inventare/django-image-uploader-widget/main/docs/_images/behaviour_inline.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finventare%2Fdjango-image-uploader-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finventare%2Fdjango-image-uploader-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finventare%2Fdjango-image-uploader-widget/lists"}