I've configured user's username field in following way username = models.CharField( _('username'), max_length=30, unique=True, help_text=_('Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.'), validators=[ validators.RegexValidator( r'^[\w.+-]+$', _('Enter a valid username. This value may contain only ' 'letters, numbers ' 'and ./+/-/_ characters.') ), ], error_messages={ 'unique': _("A user with that username already exists."), }, )
I'm getting error in admin panel but not in django-shell. <https://lh3.googleusercontent.com/-uPZdWeP7gs4/V9ZJarrUUJI/AAAAAAAAAHM/BmcJvr8IiaIAlbsU7qpmAcGnJN06Ds4KQCLcB/s1600/Screenshot%2Bfrom%2B2016-09-12%2B11%253A49%253A46.png> <https://lh3.googleusercontent.com/-CJC2lC1ELyc/V9ZJ2eE0jEI/AAAAAAAAAHQ/VB6KOLTs8GcKrTthadl4s9DCwXF5L4p2ACLcB/s1600/Screenshot%2Bfrom%2B2016-09-12%2B11%253A52%253A30.png> Though django raises an error for maximum length in shell. Is it a bug? Or am I missing something. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3bbed56d-091d-492f-bac7-a3175df0e556%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.