first comit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
pip
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2013 Tristan Waddington <tristan.waddington@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -0,0 +1,124 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: django-gravatar2
|
||||
Version: 1.4.4
|
||||
Summary: Essential Gravatar support for Django. Features helper methods, templatetags and a full test suite!
|
||||
Home-page: https://github.com/twaddington/django-gravatar
|
||||
Author: Tristan Waddington
|
||||
Author-email: tristan.waddington@gmail.com
|
||||
License: MIT
|
||||
Keywords: django gravatar avatar
|
||||
Platform: UNKNOWN
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Environment :: Web Environment
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 2
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Framework :: Django
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
django_gravatar/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
django_gravatar/__pycache__/__init__.cpython-310.pyc,,
|
||||
django_gravatar/__pycache__/compat.cpython-310.pyc,,
|
||||
django_gravatar/__pycache__/helpers.cpython-310.pyc,,
|
||||
django_gravatar/__pycache__/models.cpython-310.pyc,,
|
||||
django_gravatar/__pycache__/tests.cpython-310.pyc,,
|
||||
django_gravatar/__pycache__/views.cpython-310.pyc,,
|
||||
django_gravatar/compat.py,sha256=akOQ0sertgWHODVaS5Pfus8kgYOoTsAkzU4ItS027oI,641
|
||||
django_gravatar/helpers.py,sha256=KFNWOI9lF2TUs2MSvt7X3O30FoBDg8541Q5oDaJjDb4,3419
|
||||
django_gravatar/models.py,sha256=lk70UUefbpp-BgHZtKABs_QPtHogwWJwq4jSzEFaoeg,21
|
||||
django_gravatar/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
django_gravatar/templatetags/__pycache__/__init__.cpython-310.pyc,,
|
||||
django_gravatar/templatetags/__pycache__/gravatar.cpython-310.pyc,,
|
||||
django_gravatar/templatetags/gravatar.py,sha256=DlCtZRSl3MuiZShKc_-QiS1iyMuBdmECiZZngBJr0O0,1573
|
||||
django_gravatar/tests.py,sha256=-O9rYKSx3-XIl0adpZwExgAsc5wfCNQdyy3EV-0_n2s,5682
|
||||
django_gravatar/views.py,sha256=ffCdUmJ-DOsHqazHwYu-8KAmZyguri4mNsEGFlxjJa4,20
|
||||
django_gravatar2-1.4.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
||||
django_gravatar2-1.4.4.dist-info/LICENSE,sha256=iX9rsN68e6AqJUw2hZCvIUCWUdsW4ffwHbdcmGUBqo8,1093
|
||||
django_gravatar2-1.4.4.dist-info/METADATA,sha256=1cWyOQWuTK1W3MUG7eSyUW1lelv54xAKb04hcXR0KSg,3799
|
||||
django_gravatar2-1.4.4.dist-info/RECORD,,
|
||||
django_gravatar2-1.4.4.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
||||
django_gravatar2-1.4.4.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
|
||||
django_gravatar2-1.4.4.dist-info/top_level.txt,sha256=dx7oRgq6Njg0p72p89k6qPkVl19Q5i5FXWYwRf_52pY,16
|
||||
@@ -0,0 +1,6 @@
|
||||
Wheel-Version: 1.0
|
||||
Generator: bdist_wheel (0.34.2)
|
||||
Root-Is-Purelib: true
|
||||
Tag: py2-none-any
|
||||
Tag: py3-none-any
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
django_gravatar
|
||||
Reference in New Issue
Block a user