2016-04-03 56 views

回答

0

django -registeration-redux使用基本用戶模型存儲有關用戶的信息。

下面的代碼是從https://raw.githubusercontent.com/macropin/django-registration/master/registration/users.py

from django.conf import settings 
from django.contrib.auth import get_user_model 

UserModel = get_user_model 

這就是進口,這裏使用:https://github.com/macropin/django-registration/blob/master/registration/models.py#L90-L105

從技術上講,所有的用戶都在此基礎用戶模型的實例,使您的超級用戶帳號是沒有什麼不同並且應該能夠登錄,除非您已經編寫了一些自定義代碼以防止超級用戶無法登錄。