Need help with django-parler?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

517 Stars 129 Forks Apache License 2.0 689 Commits 73 Opened issues


Easily translate "cheese omelet" into "omelette au fromage".

Services available


Need anything else?

Contributors list

.. image:: :target: .. image:: :target: .. image:: :target: .. image:: :target: .. image:: :target:


Simple Django model translations without nasty hacks.


  • Nice admin integration.
  • Access translated attributes like regular attributes.
  • Automatic fallback to the default language.
  • Separate table for translated fields, compatible with django-hvad_.
  • Plays nice with others, compatible with django-polymorphic, django-mptt and such:

    • No ORM query hacks.
    • Easy to combine with custom Manager or QuerySet classes.
    • Easy to construct the translations model manually when needed.

See the documentation_ for more details.

A brief overview

Installing django-parler

The package can be installed using:

.. code-block:: bash

pip install django-parler

Add the following settings:

.. code-block:: python


Optionally, the admin tabs can be configured too:

.. code-block:: python

    None: (
        {'code': 'en',},
        {'code': 'en-us',},
        {'code': 'it',},
        {'code': 'nl',},
    'default': {
        'fallback': 'en',             # defaults to PARLER_DEFAULT_LANGUAGE_CODE
        'hide_untranslated': False,   # the default; let .active_translations() return fallbacks too.


with the
when you run a multi-site project with the sites framework. Each
can be added as additional entry in the dictionary.

Make sure your project is configured for multiple languages. It might be useful to limit the

setting. For example:

.. code-block:: python

from django.utils.translation import gettext_lazy as _


LANGUAGES = ( ('en', _("English")), ('en-us', _("US English")), ('it', _('Italian')), ('nl', _('Dutch')), ('fr', _('French')), ('es', _('Spanish')), )

By default, the fallback language is the same as

. The fallback language can be changed in the settings:

.. code-block:: python


Creating models

Using the

wrapper, model fields can be marked as translatable:

.. code-block:: python

from django.db import models
from parler.models import TranslatableModel, TranslatedFields

class MyModel(TranslatableModel): translations = TranslatedFields( title = models.CharField(_("Title"), max_length=200) )

def __unicode__(self):
    return self.title

Accessing fields

Translatable fields can be used like regular fields:

.. code-block:: python

>>> object = MyModel.objects.all()[0]
>>> object.get_current_language()
>>> object.title
u'cheese omelet'

>>> object.set_current_language('fr') # Only switches >>> object.title = "omelette du fromage" # Translation is created on demand. >>>

Internally, django-parler stores the translated fields in a separate model, with one row per language.

Filtering translations

To query translated fields, use the


.. code-block:: python

MyObject.objects.translated(title='cheese omelet')

To access objects in both the current and possibly the fallback language, use:

.. code-block:: python

MyObject.objects.active_translations(title='cheese omelet')

This returns objects in the languages which are considered "active", which are:

  • The current language
  • The fallback language when
    in the

Changing the language

The queryset can be instructed to return objects in a specific language:

.. code-block:: python

>>> objects = MyModel.objects.language('fr').all()
>>> objects[0].title
u'omelette du fromage'

This only sets the language of the object. By default, the current Django language is used.


to change the language on individual objects. There is a context manager to do this temporary:

.. code-block:: python

from parler.utils.context import switch_language

with switch_language(model, 'fr'): print model.title

And a function to query just a specific field:

.. code-block:: python

model.safe_translation_getter('title', language_code='fr')

Advanced Features

This package also includes:

  • Creating the
  • Form classes for inline support.
  • View classes for switching languages, creating/updating translatable objects.
  • Template tags for language switching-buttons.
  • ORM methods to handle the translated fields.
  • Admin inlines support.

See the documentation_ for more details.

Special notes

  • Using
    doesn't work, but you can use
    as workaround.
  • Due to
    ORM restrictions 
    _ queries for translated fields should be performed in a single
  • The
    method typically needs to
    call to avoid duplicate results of the same object.


  • The list code currently performs one query per object. This needs to be reduced.
  • Preferably, the
    proxy on the model should behave like a
    , if that would nicely with the ORM too.

Please contribute your improvements or work on these area's!


This module is designed to be generic. In case there is anything you didn't like about it, or think it's not flexible enough, please let us know. We'd love to improve it!

If you have any other valuable contribution, suggestion or idea, please let us know as well because we will look into it. Pull requests are welcome too. :-)

.. _django-hvad: .. _django-mptt: .. _django-fluent-pages: .. _django-polymorphic: .. _documentation:

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.