django-gravatar
================
.. image:: https://travis-ci.org/twaddington/django-gravatar.svg?branch=master
:target: https://travis-ci.org/twaddington/django-gravatar
A lightweight django-gravatar app. Includes helper methods for interacting with gravatars outside of template code.
**A Note on Continued Support**
Hey Folks, I haven't actively maintained this project for some years now. Please let me know if there are security issues or regressions in basic functionality. I will do my best to address those. However, I don't have the time to invest in other changes to the project. Additionally, I haven't been involved in Django development in many years now. If you're interested in adopting this project please shoot me a message.
--- Tristan
Features
--------
- Helper methods for constructing a gravatar url and checking an email for an existing gravatar
- Templatetags for generating a gravatar url or gravatar <img> tag.
- Full test suite!
Installing
----------
Install from PyPi:
You can pip install the app directly from GitHub:
::
$ pip install git+git://github.com/twaddington/django-gravatar.git#egg=DjangoGravatar
Alternatively, you can now install directly from PyPi!
::
$ pip install django-gravatar2
Make sure you install `django-gravatar2 <http://pypi.python.org/pypi/django-gravatar2>`_ as
there are several other incompatible django-gravatar libraries available.
Add django_gravatar to your INSTALLED_APPS in settings.py:
::
INSTALLED_APPS = (
# ...
'django_gravatar',
)
Basic Usage
-----------
Use in code:
::
from django_gravatar.helpers import get_gravatar_url, has_gravatar, get_gravatar_profile_url, calculate_gravatar_hash
url = get_gravatar_url('alice@example.com', size=150)
gravatar_exists = has_gravatar('bob@example.com')
profile_url = get_gravatar_profile_url('alice@example.com')
email_hash = calculate_gravatar_hash('alice@example.com')
Use in templates:
::
{% load gravatar %}
{% gravatar_url user.email 150 %}
# https://secure.gravatar.com/avatar/hash.jpg?size=150
{% gravatar user.email 150 %}
# <img class="gravatar" src="https://secure.gravatar.com/avatar/hash.jpg?size=150" width="150" height="150" alt="" />
{% gravatar user.email 150 "user@example.com" %}
# <img class="gravatar" src="https://secure.gravatar.com/avatar/hash.jpg?size=150" width="150" height="150" alt="user@example.com" />
{% gravatar_profile_url user.email %}
# https://secure.gravatar.com/hash
Configuring
-----------
The following options can be configured in your settings.py:
GRAVATAR_URL # Gravatar base url. Defaults to 'http://www.gravatar.com/'
GRAVATAR_SECURE_URL # Gravatar base secure https url. Defaults to 'https://secure.gravatar.com/'
GRAVATAR_DEFAULT_SIZE # Gravatar size in pixels. Defaults to '80'
GRAVATAR_DEFAULT_IMAGE # An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'. Defaults to 'mm'
GRAVATAR_DEFAULT_RATING # One of the following: 'g', 'pg', 'r', 'x'. Defaults to 'g'
GRAVATAR_DEFAULT_SECURE # True to use https by default, False for plain http. Defaults to True
Contributing
------------
Feel free to `fork django-gravatar <https://github.com/twaddington/django-gravatar>`_
on GitHub! We'd love to see your pull requests. Please make sure you run
tests before submitting a patch.
Run tests:
::
$> cd example_project
$> ./manage.py test django_gravatar
Raw data
{
"_id": null,
"home_page": "https://github.com/twaddington/django-gravatar",
"name": "django-gravatar2",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "django gravatar avatar",
"author": "Tristan Waddington",
"author_email": "tristan.waddington@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7c/51/e3a278d7f9a505abeccf7b12995b1d24c3f22657fee30ac39ca5b64af293/django_gravatar2-1.4.5.tar.gz",
"platform": null,
"description": "django-gravatar\n================\n\n.. image:: https://travis-ci.org/twaddington/django-gravatar.svg?branch=master\n :target: https://travis-ci.org/twaddington/django-gravatar\n\nA lightweight django-gravatar app. Includes helper methods for interacting with gravatars outside of template code.\n\n **A Note on Continued Support**\n\n Hey Folks, I haven't actively maintained this project for some years now. Please let me know if there are security issues or regressions in basic functionality. I will do my best to address those. However, I don't have the time to invest in other changes to the project. Additionally, I haven't been involved in Django development in many years now. If you're interested in adopting this project please shoot me a message.\n \n --- Tristan\n\nFeatures\n--------\n\n- Helper methods for constructing a gravatar url and checking an email for an existing gravatar\n- Templatetags for generating a gravatar url or gravatar <img> tag.\n- Full test suite!\n\nInstalling\n----------\nInstall from PyPi:\n\nYou can pip install the app directly from GitHub:\n\n::\n\n $ pip install git+git://github.com/twaddington/django-gravatar.git#egg=DjangoGravatar\n\nAlternatively, you can now install directly from PyPi!\n\n::\n\n $ pip install django-gravatar2\n\nMake sure you install `django-gravatar2 <http://pypi.python.org/pypi/django-gravatar2>`_ as\nthere are several other incompatible django-gravatar libraries available.\n\nAdd django_gravatar to your INSTALLED_APPS in settings.py:\n\n::\n\n INSTALLED_APPS = (\n # ...\n 'django_gravatar',\n )\n\nBasic Usage\n-----------\nUse in code:\n\n::\n\n from django_gravatar.helpers import get_gravatar_url, has_gravatar, get_gravatar_profile_url, calculate_gravatar_hash\n\n url = get_gravatar_url('alice@example.com', size=150)\n gravatar_exists = has_gravatar('bob@example.com')\n profile_url = get_gravatar_profile_url('alice@example.com')\n email_hash = calculate_gravatar_hash('alice@example.com')\n\nUse in templates:\n\n::\n\n {% load gravatar %}\n\n {% gravatar_url user.email 150 %}\n # https://secure.gravatar.com/avatar/hash.jpg?size=150\n\n {% gravatar user.email 150 %}\n # <img class=\"gravatar\" src=\"https://secure.gravatar.com/avatar/hash.jpg?size=150\" width=\"150\" height=\"150\" alt=\"\" />\n\n {% gravatar user.email 150 \"user@example.com\" %}\n # <img class=\"gravatar\" src=\"https://secure.gravatar.com/avatar/hash.jpg?size=150\" width=\"150\" height=\"150\" alt=\"user@example.com\" />\n\n {% gravatar_profile_url user.email %}\n # https://secure.gravatar.com/hash\n\nConfiguring\n-----------\nThe following options can be configured in your settings.py:\n\nGRAVATAR_URL # Gravatar base url. Defaults to 'http://www.gravatar.com/'\n\nGRAVATAR_SECURE_URL # Gravatar base secure https url. Defaults to 'https://secure.gravatar.com/'\n\nGRAVATAR_DEFAULT_SIZE # Gravatar size in pixels. Defaults to '80'\n\nGRAVATAR_DEFAULT_IMAGE # An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'. Defaults to 'mm'\n\nGRAVATAR_DEFAULT_RATING # One of the following: 'g', 'pg', 'r', 'x'. Defaults to 'g'\n\nGRAVATAR_DEFAULT_SECURE # True to use https by default, False for plain http. Defaults to True\n\nContributing\n------------\nFeel free to `fork django-gravatar <https://github.com/twaddington/django-gravatar>`_\non GitHub! We'd love to see your pull requests. Please make sure you run\ntests before submitting a patch.\n\nRun tests:\n\n::\n\n $> cd example_project\n $> ./manage.py test django_gravatar\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Essential Gravatar support for Django. Features helper methods, templatetags and a full test suite!",
"version": "1.4.5",
"project_urls": {
"Homepage": "https://github.com/twaddington/django-gravatar"
},
"split_keywords": [
"django",
"gravatar",
"avatar"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "95e322cd408d91f1732582dc266654e8cbc10a5e8c9e8036f299e70bea6827ea",
"md5": "28cd78b3d66b30469886ddd994758ebb",
"sha256": "7e6c8f63f59b0077d42402531684807ea6295867ebd2195a638d87b851f0d41c"
},
"downloads": -1,
"filename": "django_gravatar2-1.4.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "28cd78b3d66b30469886ddd994758ebb",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 8180,
"upload_time": "2024-08-29T22:34:15",
"upload_time_iso_8601": "2024-08-29T22:34:15.655085Z",
"url": "https://files.pythonhosted.org/packages/95/e3/22cd408d91f1732582dc266654e8cbc10a5e8c9e8036f299e70bea6827ea/django_gravatar2-1.4.5-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7c51e3a278d7f9a505abeccf7b12995b1d24c3f22657fee30ac39ca5b64af293",
"md5": "d8d199dcfe931ba6fc114484d31c92cd",
"sha256": "2dbb56465e395dd8b3920d4017e27a4756912cc2ad9b11ba48cf143871a80364"
},
"downloads": -1,
"filename": "django_gravatar2-1.4.5.tar.gz",
"has_sig": false,
"md5_digest": "d8d199dcfe931ba6fc114484d31c92cd",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10444,
"upload_time": "2024-08-29T22:34:16",
"upload_time_iso_8601": "2024-08-29T22:34:16.818136Z",
"url": "https://files.pythonhosted.org/packages/7c/51/e3a278d7f9a505abeccf7b12995b1d24c3f22657fee30ac39ca5b64af293/django_gravatar2-1.4.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-29 22:34:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "twaddington",
"github_project": "django-gravatar",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "django-gravatar2"
}