Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mixxorz/django-inline-svg
A simple SVG template tag for Django
https://github.com/mixxorz/django-inline-svg
django svg templatetag
Last synced: 17 days ago
JSON representation
A simple SVG template tag for Django
- Host: GitHub
- URL: https://github.com/mixxorz/django-inline-svg
- Owner: mixxorz
- License: mit
- Created: 2016-03-24T12:03:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-08T16:54:02.000Z (almost 5 years ago)
- Last Synced: 2024-10-10T05:34:48.682Z (about 1 month ago)
- Topics: django, svg, templatetag
- Language: Python
- Size: 20.5 KB
- Stars: 73
- Watchers: 1
- Forks: 14
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE
Awesome Lists containing this project
README
django-inline-svg |latest-version|
==================================|build-status| |software-license|
A simple plugin that adds an ``svg`` template tag to inline your SVGs in your
Django templates.Update 2019: Don't fear the lack of updates. This library still works. I use it for every project.
Installation
------------Install it from pypi.
::
$ pip install django-inline-svg
Add ``svg`` to your ``INSTALLED_APPS``.
::
INSTALLED_APPS = (
...
'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.svgUse the ``svg`` template tag.
::
{% load svg %}
{% svg 'logo' %}
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 2.0 on Python 2.7, 3.4, 3.5, 3.6.
License
-------MIT
.. |latest-version| image:: https://img.shields.io/pypi/v/django-inline-svg.svg
:target: https://pypi.python.org/pypi/django-inline-svg/
:alt: Latest version
.. |build-status| image:: https://img.shields.io/travis/mixxorz/django-inline-svg/master.svg
:target: https://travis-ci.org/mixxorz/django-inline-svg
:alt: Build status
.. |software-license| image:: https://img.shields.io/pypi/l/django-inline-svg.svg
:target: https://github.com/mixxorz/django-inline-svg/blob/master/LICENSE
:alt: Software license