Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
django-initials-avatar
Readme
Summary | A ridiculously simple avatar generator with initials from names. |
---|---|
Original Repository | eddiejibson/avatars |
Django Packages | packages/django-initials-avatar |
First add the application to your Python path. The easiest way is to use pip:
pip install django-initials-avatar
Check the Release History tab on the PyPI package page for pre-release versions. These can be downloaded by specifying the version.
You can also install by downloading the source and running:
python setup.py install
Make sure you have add the django_initials_avatar application to your INSTALLED_APPS list:
INSTALLED_APPS = (
...
'django_initials_avatar',
)
Then ensure that your project URL conf is updated.
from django.urls import path, include
urlpatterns = [
...
path("initials-avatar/", include('django_initials_avatar.urls'))
]
INITIALS_AVATAR_BG_COLORS = [
"#E284B3", "#FFED8B", "#681313", "#F3C1C6", "#735372", "#009975", "#FFBD39", "#B1E8ED", "#52437B", "#F76262",
"#216583", "#293462", "#DD9D52", "#936B93", "#6DD38D", "#888888", "#6F8190", "#BCA0F0", "#AAF4DD", "#96C2ED",
"#3593CE", "#5EE2CD", "#96366E", "#E38080"
]
INITIALS_AVATAR_TEXT_COLOR = '#fff'
INITIALS_AVATAR_TEXT_LENGTH = 2
INITIALS_AVATAR_WIDTH = 500
INITIALS_AVATAR_HEIGHT = 500
INITIALS_AVATAR_FONT_SIZE = 250
INITIALS_AVATAR_ROUNDED = False
INITIALS_AVATAR_CAPITALIZE = False
INITIALS_AVATAR_LOWERCASE = False
INITIALS_AVATAR_BOLD = False
INITIALS_AVATAR_CACHE_TIMEOUT = 60 * 60
In most cases it will probably be more efficient to use the template tag to get the avatar's reverse url
{% load initials_avatar %}
{% render_initials_avatar "Your Name Here" %}
You can also pass parameters
{% load initials_avatar %}
{% render_initials_avatar "Your Name Here" background="transparent" %}
Available parameters:
Make it possible to render the png instead of an svg, perhaps directly converting the svg to png. However so far the libraries need specific dll's and the intention would be to avoid this type of need.
FAQs
A ridiculously simple avatar generator with initials from names.
We found that django-initials-avatar 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.