Django Gravatar is a lightweight Django application that allows you to insert a Gravatar image in your templates.
Get it
The best way to install Django Gravatar is use easy_install.
easy_install django-simple-gravatar
If you prefer install it from source, grab the git repository from github and run setup.py
$ git clone git://github.com/skitoo/django-gravatar.git $ cd django-gravatar $ python setup.py install
Installation
Now Django Gravatar is in your PYTHONPATH. You can add this app in your project settings.py file.
INSTALLED_APPS = ( # other apps 'django_gravatar', )
You can specify a default image url, Gravatar will use it if it cannot find an account associated with the email parameter. In your settings project file add this variable
GRAVATAR_DEFAULT_URL = "http://www.example.com/mydefaultavatar.jpg"
Usage
Now you can use Django Gravatar tag in your templates. First import template tag.
{% load gravatar %}
Django Gravatar offers you two tags. The first one return gravatar image url.
{% gravatar_url user.email %}
# you can pass an optional argument to specify the avatar size. By default size is 80.
{% gravatar_url user.email 40 %}
The second one return an HTML img tag.
{% gravatar user.email %}
# you can also pass an optional size argument here.
{% gravatar user.email 40 %}
# this tag provides another argument to specify <img /> arguments.
{% gravatar user.email 40 'class="gravatar"' %}
Credits
Alexis Couronne <alexis.couronne@scopart.fr>
Metadata
Release files for django-simple-gravatar 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-simple-gravatar-1.0.1.tar.gz | 2.6 kB | Without provenance | Details for django-simple-gravatar-1.0.1.tar.gz |
Release files / django-simple-gravatar-1.0.1.tar.gz
| Download URL | django-simple-gravatar-1.0.1.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa29d80dadd8331e08e3b3de31b5b7b68b93edee49a8babd3939758c62e092d1
|
|
BLAKE2b-256 checksum How to use checksums |
546d187f2911b438244d012b8ad50e510d7e9386a86a70d7e79d61aa74bfdca3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-simple-gravatar 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.