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).