擅长:python、mysql、java
<p>将此添加到设置中:</p>
<pre><code>AUTH_USER_MODEL = 'APPNAME.User'
</code></pre>
<p>这样我们就告诉Django使用我们的自定义模型而不是默认模型。
<a href="https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#substituting-a-custom-user-model" rel="noreferrer">https://docs.djangoproject.com/en/2.2/topics/auth/customizing/#substituting-a-custom-user-model</a></p>