Provides context processors and filters for handling Bi-directional (BiDi) in django templates.
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bidiutils
docs
tests
.gitignore
.travis.yml
AUTHORS.rst
CONTRIBUTING.rst
HISTORY.rst
LICENSE
MANIFEST.in
README.rst
requirements-test.txt
requirements.txt
runtests.py
setup.py
tox.ini

README.rst

django-bidi-utils

https://badge.fury.io/py/django-bidi-utils.png https://travis-ci.org/MeirKriheli/django-bidi-utils.png?branch=master https://pypip.in/d/django-bidi-utils/badge.png

Provides context processors and filters for handling Bi-directional (BiDi) in django templates, adding some needed functionality to Django's LANGUAGE_BIDI template var.

Documentation

The full documentation is at http://django-bidi-utils.rtfd.org.

Quickstart

Install django-bidi-utils:

pip install django-bidi-utils

To use it in a Django project add bidiutils the project's INSTALLED_APPS setting:

INSTALLED_APPS = (
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sites",
    ...
    "bidiutils",
    ...
)

To enable the context processor, add it to TEMPLATE_CONTEXT_PROCESSORS settings:

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    ...
    "bidiutils.context_processors.bidi",
)

Features

  • Context processor adding to templates passed a RequestContext BiDi releated variables.
  • add_direction template filter, for adding direction to media resource (images, stylesheets, etc)