https://github.com/sveetch/django-smart-media
A suit of tools to use a FileField to upload image with light SVG support
https://github.com/sveetch/django-smart-media
django filefield python sorl-thumbnail
Last synced: 5 months ago
JSON representation
A suit of tools to use a FileField to upload image with light SVG support
- Host: GitHub
- URL: https://github.com/sveetch/django-smart-media
- Owner: sveetch
- License: mit
- Created: 2022-12-29T00:36:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-05-17T01:26:00.000Z (about 1 year ago)
- Last Synced: 2025-10-27T05:43:55.639Z (8 months ago)
- Topics: django, filefield, python, sorl-thumbnail
- Language: Python
- Homepage: https://django-smart-media.readthedocs.io/en/latest/
- Size: 177 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
Awesome Lists containing this project
README
.. _Python: https://www.python.org/
.. _Django: https://www.djangoproject.com/
.. _sorl-thumbnail: https://github.com/jazzband/sorl-thumbnail
==================
Django smart media
==================
A suit of tools to use a FileField to upload image with light SVG support, include
thumbnail preview in field and a template tag around `sorl-thumbnail`_ library.
Dependencies
************
* `Python`_>=3.10;
* `Django`_>=4.2;
* `sorl-thumbnail`_>=12.9.0;
Overview
********
Concretely this contains:
* Form widgets to build HTML for a ``FileField`` either with or without clearable
mode. Both mode have a version to include needed layout assets (CSS and Javascript)
and another one without assets;
* Form fields which already set a "smart" widget;
* Templates to build the widgets HTML;
* CSS and Javascript for the widget layout;
* Field validator;
* Model signals to purge stale files;
* Model field with all "smart" features;
* A template tag to make thumbnail safely with SVG image (original SVG is just used
without Sorl raising issue for a non bitmap image);
* Some helpers to ease some specific implementations;
Although this can work with ``ImageField``, SVG support will only work with
``FileField`` since ``ImageField`` rely on PIL that does not support SVG format.
Links
*****
* Read the documentation on `Read the docs `_;
* Download its `PyPi package `_;
* Clone it on its `Github repository `_;