
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
django-fontawesome-5
Advanced tools
A utility for using icons in models, forms, and templates. Does support Django 3.0, which django-fontawesome will not.
pipenv install django-fontawesome-5
Add 'fontawesome_5' to your installed INSTALLED_APPS
:
INSTALLED_APPS = (
...
'fontawesome_5',
)
Import and use IconField
:
from fontawesome_5.fields import IconField
class Category(models.Model):
...
icon = IconField()
Include Static Files
{% load fontawesome_5 %}
<head>
{% fontawesome_5_static %}
...
</head>
You can configure django-fontawesome to use another release/source/cdn by specifying::
FONTAWESOME_5_CSS = URL or None
default: 'fontawesome_5/css/django-fontawesome.css'
FONTAWESOME_5_CSS_ADMIN = URL or path
default: None
FONTAWESOME_5_ICON_CLASS = 'default' or 'semantic_ui'
default: 'default'
FONTAWESOME_5_PREFIX = 'custom_prefix'
default: 'fa'
You can do a simple render in your template like this:
{% for category in categories.all %}
{% if category.icon %}
{{ category.icon.as_html }}
{% endif %}
{% endfor %}
Or you can use the {% fa5_icon %}
template tag.
{% fa5_icon 'github' 'fab' %}
Positional arguments: icon
(required), style_prefix
(default: 'fas')
extra custom classes
CSS Color Names
boolean
boolean
horizontal
vertical
boolean
left
right
boolean
integer
fa-xs
fa-sm
fa-lg
fa-2x
fa-3x
fa-5x
fa-7x
fa-10x
boolean
string
Or you can use the {% fa5_icon %}
template tag.
{% fa5_icon 'check' %}
Required positional arguments: icon
extra custom classes
boolean
boolean
Semantic UI Colors
boolean
boolean
horizontal
vertical
boolean
boolean
boolean
clockwise
counterclockwise
boolean
integer
fa-xs
fa-sm
fa-lg
fa-2x
fa-3x
fa-5x
fa-7x
fa-10x
string
Credit to https://github.com/redouane for the original ~
FAQs
A utility for using icons in models, forms, and templates.
We found that django-fontawesome-5 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.