I am a starter in python. Now I am working on a Django project.
I saw many lines of code containing _('password')
, _('last_login')
etc.
Check the code below:
username = models.CharField(
_('username'),
max_length=150,
unique=True,
help_text=_('Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.'),
validators=[username_validator],
error_messages={
'unique': _("A user with that username already exists."),
},
)
What is the use of _('username')
?