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.

Dependancies

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;

  • Templates to build the widgets HTML;

  • CSS and Javascript for the widget layout;

  • Form fields which already set a “smart” widget;

  • Field validator;

  • Model signals to purge stale files;

  • Model field with all “smart” features;

  • A template tag to make a thumbnail that can be used either in the form for preview or to be used in frontend for content thumbnail. By default, the thumbnail is made in the original content format. Also not than a SVG cannot be converted to a Bitmap and vice versa;

  • 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.2.1.tar.gz (19.0 kB view hashes)

Uploaded Source

Supported by

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