[Django]-Name '_' is not defined

73👍

You miss this:

from django.utils.translation import gettext as _

Read more info from Django i18n docs. It’s an idiomatic method in Django/python projects.

👤iMom0

4👍

It should be this now
django.utils.translation import ugettext_lazy as _

Leave a comment