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.
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
Using Font Awesome Free with Django
Add the Font Awesome Free Requirement and App
Start by adding Font Awesome Free to your project’s requirements by placing this in your project’s requirements.txt file and replace version_number with the version of Font Awesome you are using.
Next, add Font Awesome Free to your Django installation by adding 'fontawesomefree' to the INSTALLED_APPS in your Django settings.py file.
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:
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:
Or if you want to use SVGs, here’s that same example with the Solid and Brands styles using SVG+JS:
Alternate Install: Using all.css or all.js
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:
Or if you’d prefer to use our Web Font + CSS technology, add a <link> element like below:
Start by adding Font Awesome Pro to your project’s requirements by placing this in your project’s requirements.txt file 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 in your Django settings.py file.
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.
Or if you want to use SVGs, here’s that same example with the Solid and Brands styles using SVG+JS:
Alternate Install: Using all.css or all.js
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:
Or if you’d prefer to use our Web Font + CSS technology, add a <link> element like below: