Skip to main content

A simple Tag to implement Feather Icons in Django

Project description

Django Feather

A simple Tag ({% icon "name" %}) to implement Feather Icons in Django.

Install

Install django-feather using pip and put it into your INSTALLED_APPS:

pip install django-feather

settings.py:

INSTALLED_APPS = [
    # ...
    'django_feather',
    # ...
]

Usage

After installation, the tag can be used just like any other tag:

{% load icon %}

<p>Using a string {% icon "coffee" class="css-class" height="8" width="8" %}</p>
<p>Using a variable {% icon self.icon class="css-class" height="8" width="8" %}</p>

The icon tag will simply take the SVG source from the Feather project, apply additional attributes and return the SVG tag.

Performance

django-feather does not read the .svg files each time an icon is rendered. Instead, all the icons are written to a .py file upon build, just like the JavaScript library.
However, other than the JavaScript library, icons are rendered on the server side. This avoids having to call feather.replace() after the page has loaded.

License

Feather is licensed under the MIT License.

django-feather is licensed under the Apache License, Version 2.0:

Copyright 2020 Jonas Drotleff <j.drotleff@desk-lab.de>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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-feather-0.2.6.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_feather-0.2.6-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file django-feather-0.2.6.tar.gz.

File metadata

  • Download URL: django-feather-0.2.6.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for django-feather-0.2.6.tar.gz
Algorithm Hash digest
SHA256 cbfccda50a664e77ac5ef823e00b11c40e09e4f8cae3758af370479c925c0081
MD5 b7a2c4b99a7a143e1d200619611d8e92
BLAKE2b-256 d27fcfe3734eaec65a38cf2a20311b091b4d2c10b3f0c078fb62d45126b6c573

See more details on using hashes here.

File details

Details for the file django_feather-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: django_feather-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for django_feather-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8db844056b1732b992ccfb6b7080ada8bf024a0e5d7dad66e36bb2616eb63002
MD5 fc6f85073bbf5f87b1cedb5af01f48f4
BLAKE2b-256 9b68125358cb63f7da68ac05146b7767253b7a97356e7041469253ce247588cf

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