Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.4 instead.
Reason given by maintainers: Broken

Font-Awesome-Flask

PyPI Supported Python Versions pre-commit.ci status Documentation Status PyPI - License

Font-Awesome-Flask is an extension for Flask that adds support for Font Awesome to your web application. It adds methods to load Font Awesome's resources (both Web Fonts + CSS and SVG + JS are supported) and render icons.

Installation

From PyPI

Font-Awesome-Flask is available on PyPI. Install with pip or your package manager of choice:

pip install Font-Awesome-Flask

From source

If you'd like, you can also install Font-Awesome-Flask from source (with flit):

git clone https://github.com/sgraaf/font-awesome-flask.git
cd font-awesome-flask
python3 -m pip install flit
flit install

Documentation

Check out the Font-Awesome-Flask documentation for the User's Guide and API Reference.

Example

Configuration

Font-Awesome-Flask can be configured via the Flask configuration API, using the config attribute of the Flask object. These are the available configuration values along with their description:

Configuration value Default Description
FONT_AWESOME_SERVE_LOCAL False Whether to serve Font Awesome's resources locally or from the CDN.

Initialization

Initialize the extension with the Flask application normally...:

from flask import Flask
from flask_font_awesome import FontAwesome

app = Flask(__name__)
font_awesome = FontAwesome(app)

... or using the Application Factory pattern:

from flask import Flask
from flask_font_awesome import FontAwesome

font_awesome = FontAwesome()


def create_app():
    app = Flask(__name__)
    font_awesome.init_app(app)
    return app

Loading resources

Font-Awesome-Flask provides three helper methods to load Font Awesome's resources: font_awesome.load(), font_awesome.load_js() and font_awesome.load_css().

Font Awesome can be used either via Web Fonts + CSS or via SVG + JS. Use the load_css() method for the former, and load_js() for the latter. You can also use the more general load(), which defaults to SVG + JS.

Whichever resource(s) you end up using, you can load them by including any of the load() methods in the head of your base template:

<head>
    ...
    {{ font_awesome.load_js() }}
    ...
</head>
<body>
    ...
</body>

Rendering icons

Font-Awesome-Flask provides two ways of rendering icons: via the font_awesome.render_icon() and font_awesome.render_stacked_icons() methods...:

{{font_awesome.render_icon("fas fa-house")}}
{{font_awesome.render_stacked_icons("fas fa-square", "fas fa-house")}}

... or via the Jinja macros of the same names:

{% from 'font_awesome.html' import render_icon, render_stacked_icons %}
{{ render_icon('fas fa-house') }}
{{ render_stacked_icons('fas fa-square', 'fasfa-house') }}

Metadata

Release files for Font-Awesome-Flask 0.1.5

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

Source distribution (sdist)

Source distribution for Font-Awesome-Flask 0.1.5
File Size Uploaded
font_awesome_flask-0.1.5.tar.gz 572.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Font-Awesome-Flask 0.1.5
File Interpreter ABI Platform
font_awesome_flask-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / font_awesome_flask-0.1.5.tar.gz

Download URL font_awesome_flask-0.1.5.tar.gz
Size 572.1 kB
Tags Source
SHA-256 checksum
How to use checksums
499e1ad6d3f45e825601644d466077e3b687a989a8629b65db5bc76af7a0222a
BLAKE2b-256 checksum
How to use checksums
c2567a703a394b70e36fd2fc82539cff085a1a84652d95d68f711b480de0c3ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release files / font_awesome_flask-0.1.5-py3-none-any.whl

Download URL font_awesome_flask-0.1.5-py3-none-any.whl
Size 561.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65d7333ea595bcfa5e2fa688113f3220efb8fe7b5a39412f7ad2a8fa1169b1dd
BLAKE2b-256 checksum
How to use checksums
d6d1d49504bf90e43c0797fa92dfcff267889ab483aff185a5b0f65e5f94bd78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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