Skip to main content

A usefull and incredible Django application that allow you to use emoticons in your templates :)

Project description

Build Status - develop branch Coverage of the code

Django-emoticons is a django application providing utilities to add emoticons in your templates. Pretty incredible no?

Install

Once you have installed the package in your PYTHON_PATH, register the emoticons app in your INSTALLED_APPS project’s section.

INSTALLED_APPS = (
  ...
  'emoticons',
  ...
)

Usage

Filter Usage

For our example we will make a template who display the field content of a model, this field has this value:

Coding is fun and sexy :D

So in our templates we will load the emoticons_tags library and use the emoticons filter:

{% load emoticons_tags %}

{{ object.content|emoticons }}

Which will render:

Coding is fun and sexy smile

Tag Usage

The emoticons app also provides a tag named emoticons for converting raw text.

{% load emoticons_tags %}
{% emoticons %}
Documenting is boring but usefull :p
{% endemoticons %}

Which will render :

Documenting is boring but usefull razz

Index

If you want to retrieve a list of all availables emoticons you can use the emoticons_index tag.

{% load emoticons_tags %}
{% emoticons_index as emoticons_list %}
{% for emoticons in emoticons_list %}
<p>{{ emoticons.0|emoticons }}: {{ emoticons|join:" " }}</p>
{% endfor %}

Settings

You can use differents settings for customizing the application:

  • EMOTICONS_DIRECTORY

    The directory where the emoticons files are located, use 'emoticons' as default.

  • EMOTICONS_LIST

    The list of the emoticons used by the application, something like this:

    (('(devil)', 'devil.gif'),
     ('(angel)', 'angel.gif'),
     ((':)', ':-)', ':=)', '(smile)'), 'smile.gif'),
     ((':(', ':-(', ':=(', '(sad)'), 'sadsmile.gif'),
    )

If the HTML code of the emoticons does not fit to your needs, you can override the 'emoticons/emoticon.html' template to adjust it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-emoticons-1.1.1.tar.gz (117.9 kB view details)

Uploaded Source

Built Distribution

django_emoticons-1.1.1-py2.py3-none-any.whl (142.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-emoticons-1.1.1.tar.gz.

File metadata

File hashes

Hashes for django-emoticons-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f045e2074b9a79a6d742e6fe09ba97f28be177f9a8f4cc2cb4a15cf8d9c91dc3
MD5 4505948a0c33be6254f78dbee801d2e6
BLAKE2b-256 0c428cb8c141a5495715149b97b3235ff55dd8de5b08a1d2b456abb85b969bf1

See more details on using hashes here.

File details

Details for the file django_emoticons-1.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_emoticons-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9e8b2f01fc77e89ecb276167d9c43c543bf374ad0294b0a73cd2115760ad028c
MD5 783bc69867ab3ba4ef7a4e695a44eb0d
BLAKE2b-256 f62aaf0883e63ceee4ce3693a8e3028044b4db475de261752513d9c9cb70b4e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page