Font Awesome Free

6.6.0 · maintenance · verified Thu Apr 16

This Python package provides the static assets for Font Awesome Free icons, currently mirroring Font Awesome version 6.6.0. It's primarily designed for integration into Python web frameworks like Django, allowing developers to easily serve Font Awesome's CSS and JavaScript files for their web applications. While the upstream Font Awesome library has released version 7, the `fontawesomefree` PyPI package is not actively updated for Font Awesome 7 and is officially deprecated for new projects aiming for Font Awesome 7 integration.

Common errors

Warnings

Install

Quickstart

The `fontawesomefree` package provides static files, not Python-callable functions. Its primary use in Python projects, especially Django, involves installing the package and then referencing its static CSS and JavaScript files in HTML templates. This example demonstrates how to set it up in a Django project's `settings.py` and `base.html` to enable Font Awesome icons. You would typically use `os.environ.get` for sensitive data, but for static asset paths, it's not applicable here.

import os

# For Django projects, add 'fontawesomefree' to INSTALLED_APPS in settings.py
# Then, include the static files in your base HTML template.

# settings.py example:
# INSTALLED_APPS = [
#     # ... other apps
#     'fontawesomefree',
#     # ...
# ]

# base.html (Django template) example:
# {% load static %}
# <head>
#     <!-- ... other head content ... -->
#     <link href="{% static 'fontawesomefree/css/all.min.css' %}" rel="stylesheet" type="text/css">
#     <script src="{% static 'fontawesomefree/js/all.min.js' %}"></script>
# </head>
# <body>
#     <i class="fas fa-home"></i> Home
#     <i class="fab fa-python"></i> Python
# </body>

view raw JSON →