Django file fields with SVG support
Project description
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.9;
Django>=4.0,<5.1;
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;
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django_smart_media-0.4.1.tar.gz
.
File metadata
- Download URL: django_smart_media-0.4.1.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9da9998553fee1c396c37ae35cbea8b700ec7f4105b872dfcdc5f09ccb3e37 |
|
MD5 | bd53a8871c7dc875418315b28ceb41eb |
|
BLAKE2b-256 | fbe261e187db28696418c7b102d2cb85b9b55afa37768bea4986899f50c208fd |