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.

Install

Install the package in your PYTHON_PATH by getting the sources and run setup.py or use pip:

$ pip install -e git://github.com/Fantomas42/django-emoticons.git#egg=django-emoticons

Then register the emoticons app in your INSTALLED_APPS project’s section.

Examples

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 emoticon_tags library and use the emoticons filter:

{% load emoticon_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 emoticon_tags %}
{% emoticons %}
Documenting is boring but usefull :p
{% endemoticons %}

Which will render :

Documenting is boring but usefull razz

So cool, no ?

Settings

You can use differents settings for customizing the application:

  • EMOTICONS_URL

    The url where the emoticons files are located, use this as default.:

    os.path.join(settings.MEDIA_URL, 'emoticons/'))
  • EMOTICONS_CLASS

    The class wo will be applied to the img markup of the emoticons.

  • EMOTICONS_LIST

    The list of the emoticons who will be converted. It’s something like that:

    ((':)', 'smile.gif'),
     (':D', 'mrgreen.gif'),
     (':(', 'sad.gif'),
     (':|', 'neutral.gif'),
     (';)', 'wink.gif'),
     (':p', 'razz.gif'),
     (':P', 'razz.gif'),
     (':o', 'surprised.gif'),
     (':O', 'surprised.gif'),
     (':s', 'confused.gif'),
     (':S', 'confused.gif'),
     (':$', 'confused.gif'),
     ('o_O', 'eek.gif'),
     )

Of course the package does not provide the images, is your job to find and set them in your project.

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-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-emoticons-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bada7ed66294ff2079ab0b72490f4a1d80b92ff66f1fc354273f0cb8336f8ea2
MD5 9366b07e19c3afa611a9a8dbd6c94c78
BLAKE2b-256 e3a18ff242c9f5271d7443cbb44d337bc13db9b2668aad23802c36cd0f49bd66

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