Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Install using pip.
pip install django-icons
In your settings.py
, add django_icons
to INSTALLED_APPS
and define an icon.
INSTALLED_APPS = (
# ...
"django_icons",
# ...
)
DJANGO_ICONS = {
"ICONS": {
"edit": {"name": "fa-solid fa-pencil"},
},
}
Render an icon in a Django template.
{% load icons %}
<!-- Include your icon library. This example uses Font Awesome 6 through cdnjs. -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
{% icon 'edit' %}
This will generate the FontAwesome 6 pencil icon in regular style.
<i class="fa-solid fa-pencil"></i>
Add extra classes and attributes to your predefined icon.
{% load icons %}
{% icon 'edit' extra_classes='fa-2xs my-extra-class' title='Update' %}
These will be added to the HTML output.
<i class="fa-solid fa-pencil fa-2xs my-extra-class" title="Update"></i>
This package requires a combination of Python and Django that is currently supported.
See "Supported Versions" on https://www.djangoproject.com/download/.
This section assumes you know about local Python versions and virtual environments.
To clone the repository and install the requirements for local development:
$ git clone git://github.com/zostera/django-icons.git
$ cd django-icons
$ pip install -e .
$ pip install -U pip -r requirements-dev.txt
You can run the example app:
cd example && run python manage.py runserver
The test suite requires tox to be installed. Run the complete test suite like this:
tox
Test for the current environment can be run with the Django manage.py
command.
python manage.py test
Our plans at Zostera for an icon tool originate in https://github.com/dyve/django-bootstrap3. We isolated this into a Font Awesome tool in https://github.com/zostera/django-fa. When using our own product, we felt that the icon tool provided little improvement over plain HTML. Also, Font Awesome's icon names did not match the intended function of the icon.
This is how we came to think of a library that:
This is how we came to write and use django-icons
.
FAQs
Icons for Django
We found that django-icons demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.