The easiest and fastest way to increase your default Django username: 30 to 75

so I saw a lot of solutions, but found most of the answers for older versions of Django, and I was wondering if there were any changes.

I mainly use Django 1.7, and I need to redefine the u username field in the standard django user class to allow more than 30 characters ie max_length=75 .

Should I use AbstractBaseUser instead or is there an easier way to set max_length=75

+6
source share
1 answer

Yes, I think you have to go along the user route.

You can look here to breathe in https://github.com/jcugat/django-custom-user , that the package implements contrib.auth.User, except without a username and just using email. address. You can probably decide how to do what you want from there.

A similar question was posted where the user described in detail a very hacker job, but this could help you: A longer username in Django 1.7

+3
source

Source: https://habr.com/ru/post/980833/


All Articles