我正在使用默认的Django用户后端。我只想做一个小改动:将max_length
的{{1}}减少到30(我相信默认值是150)。我怎么做到这一点?
我使用django-allauth作为我的用户帐户框架,这是我当前的自定义allauth注册表单:
draft1 /表格
username
draft1 / settings.py
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
知道如何将ACCOUNT_SIGNUP_FORM_CLASS = 'draft1.forms.AllauthSignupForm'
max_length更改为30?