【问题标题】:How do I remove the "Account" section from the Django Admin Page如何从 Django 管理页面中删除“帐户”部分
【发布时间】:2021-07-23 16:41:45
【问题描述】:

我想从 Django 管理页面中删除“帐户”部分。

我不知道我需要什么模型来取消注册()。

【问题讨论】:

标签: django


【解决方案1】:

您似乎正在使用第三方应用程序django-user-accounts

要禁用此功能,请将其添加到您的 admin.py 文件中:

from django.contrib import admin
from account.models import (
 Account,
 AccountDeletion,
 EmailAddress,
 PasswordExpiry,
 PasswordHistory,
)

admin.site.unregister(Account)
admin.site.unregister(AccountDeletion)
admin.site.unregister(EmailAddress)
admin.site.unregister(PasswordExpiry)
admin.site.unregister(PasswordHistory)

如果您不需要此应用程序,请将其从您的INSTALLED_APPS 设置中删除:

INSTALLED_APPS = (
    # ...
    "account",
    # ...
)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-18
    • 2011-08-10
    • 2019-04-10
    • 2021-05-30
    • 2018-02-22
    • 1970-01-01
    • 2011-08-20
    • 1970-01-01
    相关资源
    最近更新 更多