[Django]-"global name '_' is not defined" during raising ValidationError

11👍

You are missing this line:

from django.utils.translation import ugettext as _
👤Gocht

1👍

For Django 3+ this has changed to:

from django.utils.translation import gettext_lazy as _

The documentation is here

Leave a comment