django_setup module

Initialize Django and its internationalization machinery.

In any file that uses django modules, always import django_setup first.

To localize strings in Python files, import either gettext_lazy or ugettext from this module as _, then use _(‘foo’) to mark the strings to be translated. Use gettext_lazy for strings that are declared before a language has been selected; ugettext for those after (ugettext is safe to use in all Handlers).

class django_setup.TemplateLoader(*args, **kwargs)[source]

Bases: django.template.loader.BaseLoader

Our custom template loader, which loads templates from Resources.

is_usable = True
load_template(name, dirs)[source]
load_template_source(name, dirs)[source]