A simple Django app to get avatars based on username and initials if no gravatars is associated to the email address.
Project description
=====
django-initial-avatars
=====
django-initial-avatars is a simple Django app which generates avatars based on username and initials if associated email adress has no gravatar
Dependencies
------------
Generating avatars requires a `Pillow`_ (or PIL) installation with `freetype`_ support.
``freetype`` can easily be installed on ubuntu with _::
$ sudo aptitude install libfreetype6-dev
or on OS X with `homebrew`_::
$ brew install freetype
After installing ``freetype`` Pillow may need to be rebuilt.
Font licensing
--------------
For generating the avatar the font ``Ubuntu Monospace`` is used.
The font is licensed under the Ubuntu Font Licence, see the
`License <http://font.ubuntu.com/licence/>`_
Quick start
-----------
1. install app requirements
2. Add "django-initial-avatars" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'initial_avatars',
)
3. Include the django-initial-avatar URLconf in your project urls.py like this::
url(r'^avatar/', include('initial_avatars.urls')),
4. Launch development server
python manage.py runserver
5. Each user has now an endpoint for his avatar:
localhost:8000/avatar/user[/size]
6. In your templates, use :
{% load initial_avatars %}
{% get_initial_avatar user [size] %}
or
{% get_initial_avatar user.email [size] %}
7. To-do:
Write Tests
Make django-gravatar2 optionnal
add settings ?
django-initial-avatars
=====
django-initial-avatars is a simple Django app which generates avatars based on username and initials if associated email adress has no gravatar
Dependencies
------------
Generating avatars requires a `Pillow`_ (or PIL) installation with `freetype`_ support.
``freetype`` can easily be installed on ubuntu with _::
$ sudo aptitude install libfreetype6-dev
or on OS X with `homebrew`_::
$ brew install freetype
After installing ``freetype`` Pillow may need to be rebuilt.
Font licensing
--------------
For generating the avatar the font ``Ubuntu Monospace`` is used.
The font is licensed under the Ubuntu Font Licence, see the
`License <http://font.ubuntu.com/licence/>`_
Quick start
-----------
1. install app requirements
2. Add "django-initial-avatars" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = (
...
'initial_avatars',
)
3. Include the django-initial-avatar URLconf in your project urls.py like this::
url(r'^avatar/', include('initial_avatars.urls')),
4. Launch development server
python manage.py runserver
5. Each user has now an endpoint for his avatar:
localhost:8000/avatar/user[/size]
6. In your templates, use :
{% load initial_avatars %}
{% get_initial_avatar user [size] %}
or
{% get_initial_avatar user.email [size] %}
7. To-do:
Write Tests
Make django-gravatar2 optionnal
add settings ?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-initial-avatars-0.1.tar.gz
(114.2 kB
view hashes)
Close
Hashes for django-initial-avatars-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e58ee627e7eaad378d6be33b3061227d85560a4a16a66a3a0fb7d2f1fc6956 |
|
MD5 | 3e7f02dfe5268dd53f32b94a41edd4f3 |
|
BLAKE2b-256 | ea2f73e6d0d9b5e04b8fa8ac3fd8b8123233f002bbe8116486b164d00a852156 |