Skip to main content

context processors and helpers for BIDI in django templates

Project description

Django Bidi Utils

Provides context processors and filters for handling Bi-directional (BiDi) in django templates.

Context processors

Add it to TEMPLATE_CONTEXT_PROCESSORS in your project’s e.g:


The context processor defines the following template variables:

  • LANGUAGE_DIRECTION: Direction of current language (ltr or rtl)
  • LANGUAGE_START: Start of language layout (right for RTL, left for LTR)
  • LANGUAGE_END – End of language layout (left for RTL, right for LTR)
  • LANGUAGE_MARKER – Language marker entity (‏ for RTL, ‎ for LTR)



Adds direction to the element



  • rtl_only: Add the direction only in case of a right-to-left language (default)
  • both: add the direction in both case
  • ltr_only: Add the direction only in case of a left-to-right language

{{image_name|add_direction}} when image_name is ‘start_arrow.png’ results in ‘start_arrow_rtl.png’ in case of RTL language, and ‘start_arrow.png’ or ‘start_arrow_ltr.png’ depends on arg value.


In this document:

Right-to-Left written language (e.g: Hebrew, Arabic)
Left-to-Right written language (e.g: English, French)



  • Added template filter add_direction
  • Removed README, add which includes README.rst


  • Initial release, context processors

Project details

Download files

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

Files for django-bidi-utils, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size django-bidi-utils-0.2.1.tar.gz (4.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page