A usefull and incredible Django application that allow you to use emoticons in your templates :)
Project description
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
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
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
File details
Details for the file django-emoticons-0.1.1.tar.gz
.
File metadata
- Download URL: django-emoticons-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bada7ed66294ff2079ab0b72490f4a1d80b92ff66f1fc354273f0cb8336f8ea2 |
|
MD5 | 9366b07e19c3afa611a9a8dbd6c94c78 |
|
BLAKE2b-256 | e3a18ff242c9f5271d7443cbb44d337bc13db9b2668aad23802c36cd0f49bd66 |