我在查找此管理文件的位置时遇到了麻烦,因此我可以添加一个额外的字段。我认为它是在安装时自动创建的。
我想在UID字段之后,特别是在列表页面(如下所示)上添加一个日期字段,以便我可以知道何时创建用户auth。
好的,这就是我尝试使用的[[Django-allauth,我认为它在某种程度上与django-socialauth相同。只需了解其要点,然后将其应用于您的代码即可
首先在您的任何admin.py文件中扩展SocialAccountAdmin
,如果在诸如“ user”,“ home”之类的特定应用程序或您喜欢的任何其他应用程序中则更好。admin.py] >>from allauth.socialaccount.admin import SocialAccountAdmin
from allauth.socialaccount.models import SocialAccount
class MySocialAccount(SocialAccountAdmin):
list_display = ('user', 'uid', 'provider', 'date_joined') # I haven't tried just adding a certain list to the list_display, for the meantime add all necessary fields just like how socialauth did
admin.site.unregister(SocialAccount) # Need to unregister the default socialaccount admin
admin.site.register(SocialAccount, MySocialAccount) # Then register it back with the custom made admin
也许也许有更好的方法可以做到这一点,但这确实完成了工作。