Skip to main content

Icons for Django

Project description

django-icons

Icons for Django

https://travis-ci.org/zostera/django-icons.svg?branch=master https://coveralls.io/repos/github/zostera/django-icons/badge.svg?branch=develop Latest PyPI version https://img.shields.io/badge/code%20style-black-000000.svg

Features

Use simple template tags to generate icons in your web application. Supports Font Awesome out of the box, easily adaptable for other icon libraries.

The basic usage in a Django template:

{% load icons %}
{% icon 'edit' %}

Requirements

Python 3 and matching supported Django versions.

Running the demo

You can run the small demo app that is part of the test suite. This requires Django, so you may have to pip install django in your environment. To run the demo, from the root of the project (where you can find manage.py, run:

python manage.py runserver

Running the tests

The test suite uses tox. Run the complete test suite like this:

tox

Run the tests only for the current environment like this:

python manage.py test

Origin

Our plans at Zostera for an icon tool originate in https://github.com/dyve/django-bootstrap3. We isolated this into a Font Awesome tool in https://github.com/zostera/django-fa. When using our own product, we felt that the icon tool provided little improvement over plain HTML. Also, Font Awesome’s icon names did not match the the intended function of the icon. This is how we came to think of a library that

  • Took a limited number of arguments

  • Converted those arguments into an icon

  • Was able to support multiple icon libraries

  • And could easily be extended by users

This is how we came to write and use django-icons.

Changelog

1.1.2 - 2020-03-21

  • Fix bug that could change icon settings in run-time

1.1.1 - 2019-12-13

  • Update Makefile, tox and Travis

1.1.0 - 2019-12-05

  • Mark Development Status as Stable in setup.py

  • Fix several issues in Makefile

  • Remove test and publish tasks from setup.py

  • Improve reformat and lint tasks

  • Use requirements.scm

1.0.0 - 2019-11-15

  • Drop support for Python < 3.5

  • Drop support for Django < 2.2

  • Add support for Django 3

  • Add support for Python 3.8

  • Add test for custom ImageRenderer

  • Add Makefile for common tasks

0.2.1 - 2018-07-01

  • Bug fixes and improvements to ImageRenderer (@mbourqui)

0.2.0 - 2018-06-30

0.1.0 - 2018-01-11

0.0.5 - 2017-12-21

  • Fix typo’s

  • Adjust tox matrix to currently supported Django versions

  • Fixed names of tests

  • Add tests for BaseRenderer

0.0.4 - 2017-06-22

  • Autogenerate docs for icon template tag

  • Fix typo in README

0.0.3 - 2017-06-22

  • Bug fixes

  • More tests

  • More documentation

0.0.2 - 2017-06-19

  • Updated docs and tests

  • Demo of custom SVG renderer included

  • FontAwesome and Bootstrap3 renderers included

  • New structure for settings dict

  • First documentation, linked to ReadTheDocs

  • First tests

  • Introducing the icon template tag

0.0.1 - 2017-06-15

  • First publication on GitHub and PyPI

  • Non-functional, just names and tests

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-icons-1.1.2.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

django_icons-1.1.2-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

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