Skip to main content
==================
django-fa disclaimer
==================

This package is basically a `django-fontawesome <https://github.com/atiberghien/django-fontawesome>`_ fork with support of latest django, uploaded to PyPi.
Reason of creating this repo was sadly ignored `merge request <https://github.com/redouane/django-fontawesome/pull/32>`_.
All the credits goes to authors of source repository and merge request.

Requirements
============

- PyYAML
- Select2 (included)
- JQuery (uses django's jquery in admin panel)


Settings
========
By default, django-fontawesome ships with and uses the lastest fontawesome release.
You can configure django-fontawesome to use another release/source/cdn by specifying::

# default uses locally shipped version at 'fontawesome/css/font-awesome.min.css'
FONTAWESOME_CSS_URL = '//cdn.example.com/fontawesome-min.css' # absolute url
FONTAWESOME_CSS_URL = 'myapp/css/fontawesome.min.css' # relative url

You can also tell it the fontawesome prefix, which as of right now is 'fa', using::

FONTAWESOME_PREFIX = 'bg' # default is 'fa'


Installation / Usage
====================

0. Install via pip::

pip install django-fa


1. Add 'fontawesome' to your installed apps setting like this::

INSTALLED_APPS = (
...
'fontawesome',
)

2. Import and use the ``IconField``::

from fontawesome.fields import IconField


class Category(models.Model):
...
icon = IconField()


Here's what the widget looks like in the admin panel:

|admin-widget|

3. You can then render the icon in your template like this::

{% for category in categories.all %}
{% if category.icon %}
{{ category.icon.as_html }}
{% endif %}
{% endfor %}


4. django-fontawesome ships with two template tags, ``fontawesome_stylesheet`` and ``fontawesome_icon``.
- the former inserts a stylesheet link with a pre-configured href according to the ``FONTAWESOME_CSS_URL`` setting
- the latter renders icons, and accepts the following optional keywords arguments: large, spin, fixed, li, border: (true/false), rotate: (90/180/270), title: (string)
- you can also colorize an icon using the ``color='red'`` keyword argument to the ``fontawesome_icon`` template tag

- example usage::

{% load fontawesome %}

<head>
{% fontawesome_stylesheet %}
...
</head>

{% fontawesome_icon 'user' color='red' %}

{% fontawesome_icon 'star' large=True spin=True %}

<ul class="fa-ul">
<li> {% fontawesome_icon 'home' rotate=90 li=True %} One</li>
</ul>



.. |admin-widget| image:: docs/images/admin-widget.png

Metadata

Release files for django-f-awesome 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-f-awesome 0.3.2
File Size Uploaded Provenance
django-f-awesome-0.3.2.tar.gz 675.0 kB Without provenance Details

Release files / django-f-awesome-0.3.2.tar.gz

Download URL django-f-awesome-0.3.2.tar.gz
Size 675.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ed9e9a02bded0222367f735e1c1dd7d8b9192a2b0a8a3588abb91bbfd9aa16ec
BLAKE2b-256 checksum
How to use checksums
32513bc3468e81d689c501f3bfde8be1a6a2a4d8108a039b064a60c7f06160ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-f-awesome 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page