Thursday 31 May 2018

How to add max_length to allauth username

I'm using Django allauth as my user account framework for my django site. The docs show there is an ACCOUNT_USERNAME_MIN_LENGTH however there is no ACCOUNT_USERNAME_MAX_LENGTH for some reason.

Is there any way to create a max length for username?

Here's my custom allauth signup form - maybe I can do something here?:

class AllauthSignupForm(forms.Form):

    captcha = ReCaptchaField(
        public_key=config("RECAPTCHA_PUBLIC_KEY"),
        private_key=config("RECAPTCHA_PRIVATE_KEY"),
    )

    class Meta:
        model = User

    def signup(self, request, user):
        """ Required, or else it throws deprecation warnings """
        pass



from How to add max_length to allauth username

1 comment:

  1. https://www.wizweb.in

    Wizweb Technology is a leading software development company custom website design, software development, SMS Provider, Bulk sms, transactional sms, promotional sms, mobile app development, Hosting Solution, seo(search engine optimization) and Digital marketing etc.

    ReplyDelete