Skip to main content

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_smart_media-0.5.0.tar.gz (20.1 kB view details)

Uploaded Source

File details

Details for the file django_smart_media-0.5.0.tar.gz.

File metadata

  • Download URL: django_smart_media-0.5.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for django_smart_media-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ceb678ebe16c8542a2da19c413d7837e72fbddbbc83596c535465aee8709e0a3
MD5 856b4f52279107ed2cf34c702dd4b85b
BLAKE2b-256 b8355a4c253809e20e6d9d6a0a569e76e175412593869675444b97c0d7e1b0e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page