我为密码编写了一个自定义哈希,它返回的密码长度为148.但Django似乎默认将SQL表中的密码长度限制为128。我该如何更改?
答案 0 :(得分:0)
正确的方法是使用覆盖密码字段的自定义用户模型:
https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model了解详情。
作为替代解决方法,您可以使用名为django-primate的第三方应用程序:https://github.com/aino/django-primate#alternative-password-hashing