A simple SVG template tag for Django
Reason this release was yanked:
This package has been renamed
Project description
django-simple-svg
A simple plugin that adds an svg
template tag to inline your SVGs in your
Django templates.
This is an updated version of this repo
https://github.com/mixxorz/django-inline-svg
Huge credit goes to Mitchel Cabuloy
Installation
Install it from pypi.
pip install django-simple-svg
Add simple_svg
to your INSTALLED_APPS
.
INSTALLED_APPS = (
...
'simple_svg',
...
)
Usage
Store your SVGs in folder named svg
at the root of any of your static file
directories.
my_app
|-- static
| |-- svg
| |-- logo.svg
| |-- check.svg
| |-- cross.svg
Use the svg
template tag.
{% load svg %}
<h1 class="logo">{% svg 'logo' class="css-class" height="16" width="16" %}</h1>
You can set SVG_DIRS
to control where to look for your svgs.
# settings.py
SVG_DIRS=[
os.path.join(BASE_DIR, 'my-svgs')
]
Support
The tests are run against Django 1.8 to 4.0.6 on Python 2.7, 3.4, 3.5, 3.6, 3.8, 3.10.
License
MIT
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.