I'm following django tutorial about raising ValidationError
in Django.
Unfortunatelly even the simplest snippet won't work. I've added below code to my validator object:
raise ValidationError(_('Invalid value'), code='invalid')
and got error
global name '_' is not defined
What did I do wrong?
You are missing this line:
from django.utils.translation import ugettext as _