Font Awesome now has an official Django plugin that's available via the Python package installer, pip, for a friction-less way to use our icons in your Django projects.
Advertisement
Remove ads with a Pro plan!
A subscription to a Pro-level plan will remove all third-party advertisements on fontawesome.com.
And of course Pro-level plans come with…
All 30,013 icons in Font Awesome
5 Classic styles of every icon
4 Sharp styles of every icon
A Perpetual License to use Pro
Services and tools to make easy work of using icons
We found an issue with the way we named our Version 5 python packages. This has been fixed in Version 6, but it meant creating new Free and Pro packages with a different name scheme - fontawesomefree and fontawesomepro.
What's installed
Let's cover the basics of the directories and files you’ll need for both Font Awesome Free and Pro. Once installed, both the Free and Pro web-focused Font Awesome packages contain the following directories and files:
Path
What It Is
Where You Should Start
/css
Stylesheets for Web Fonts
all.css
/js
SVG with JavaScript
all.js
/less
Less pre-processor
fontawesome.less
/scss
Sass pre-processor
fontawesome.scss
/sprites
SVG sprites
solid.svg
/svgs
Individual SVG for each icon
individual *.svg icons
/webfonts
Web Font files used with CSS
See /css
Ch-Ch-Check Yourself Before You Reqs Yourself!
We recommend using requirements files(opens new window) in your Python projects to install the Font Awesome package. The docs below assume that you're working this way.
Using Font Awesome Free with Django
Advertisement
Remove ads with a Pro plan!
A subscription to a Pro-level plan will remove all third-party advertisements on fontawesome.com.
And of course Pro-level plans come with…
All 30,013 icons in Font Awesome
5 Classic styles of every icon
4 Sharp styles of every icon
A Perpetual License to use Pro
Services and tools to make easy work of using icons
Start by adding Font Awesome Free to your project's requirements by placing this in your project's requirements.txt file(opens new window) and replace version_number with the version of Font Awesome you are using.
fontawesomefree==version_number
Next, add Font Awesome Free to your Django installation by adding 'fontawesomefree' to the INSTALLED_APPS(opens new window) in your Django settings.py file.
INSTALLED_APPS =['fontawesomefree']
Link the Styles You Want (Recommended)
Link the core fontawesome.css file along with the CSS files for whichever styles you want to use into the <head> of each template or page that you plan to add icons to.
Here's an example with the Solid and Brands styles using Web Fonts:
We have also provided a shortcut all.min.js or all.min.css file that includes all the Free icons as well as the core utility functions and styles. It's a handy shortcut but isn't as performant as selecting individual styles.
Here's how you would use that with SVG+JS:
<head><!-- One file includes all the Font Awesome Free icons and utilities --><scriptsrc="{% static 'fontawesomefree/js/all.min.js' %}"></script></head>
...
Or if you'd prefer to use our Web Font + CSS technology, add a <link> element like below:
<head><!-- One file includes all the Font Awesome Free icons and utilities --><linkhref="{% static 'fontawesomefree/css/all.min.css' %}"rel="stylesheet"type="text/css"></head>
...
Using Font Awesome Pro with Django
Advertisement
Remove ads with a Pro plan!
A subscription to a Pro-level plan will remove all third-party advertisements on fontawesome.com.
And of course Pro-level plans come with…
All 30,013 icons in Font Awesome
5 Classic styles of every icon
4 Sharp styles of every icon
A Perpetual License to use Pro
Services and tools to make easy work of using icons
Grab your super-secret npm token from your account and don't share it with anyone who shouldn't have it. We'll wait here...
Add the Font Awesome Pro Requirement and App
Start by adding Font Awesome Pro to your project's requirements by placing this in your project's requirements.txt file(opens new window) and replace version_number with the version of Font Awesome you are using.
Next, add Font Awesome Pro to your Django installation by adding 'fontawesomepro' to the INSTALLED_APPS(opens new window) in your Django settings.py file.
INSTALLED_APPS =['fontawesomepro']
Link the Styles You Want (Recommended)
Link the core fontawesome.css file along with the CSS files for whichever styles you want to use into the <head> of each template or page that you plan to add icons to.
We have also provided a shortcut all.min.js or all.min.css file that includes ALL of the icons in Font Awesome as well as the core utility functions and styles. It's a handy file if you'll be using all the icon styles or testing out different styles as you develop your project. But if you're using just a couple of styles, we don't recommend it for production sites since loading all of the icons and files isn't great for performance.
Here's how you would use that with SVG+JS:
<head><!-- One file includes all the Font Awesome Pro icons and utilities --><scriptsrc="{% static 'fontawesomepro/js/all.min.js' %}"></script></head>
...
Or if you'd prefer to use our Web Font + CSS technology, add a <link> element like below:
<head><!-- One file includes all the Font Awesome Pro icons and utilities --><linkhref="{% static 'fontawesomepro/css/all.min.css' %}"rel="stylesheet"type="text/css"></head>
...