Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django admin-admin中与用户相关的模块_Django_Django Models_Django Admin_Django Users - Fatal编程技术网

Django admin-admin中与用户相关的模块

Django admin-admin中与用户相关的模块,django,django-models,django-admin,django-users,Django,Django Models,Django Admin,Django Users,我使用扩展用户配置文件类名:UserProfile。我为此制作了一个名为account的应用程序。 在我设置的设置中: AUTH_PROFILE_MODULE = 'account.UserProfile' 但我在那个应用程序中制作了另一个模型,名为RestrictedUsername。我想把这些用户名,这将是保留的,在注册过程中不可用。 我不知道为什么,但它没有出现在管理面板。我注册了它: from django.contrib import admin from apps.account.

我使用扩展用户配置文件类名:UserProfile。我为此制作了一个名为account的应用程序。 在我设置的设置中:

AUTH_PROFILE_MODULE = 'account.UserProfile'
但我在那个应用程序中制作了另一个模型,名为RestrictedUsername。我想把这些用户名,这将是保留的,在注册过程中不可用。 我不知道为什么,但它没有出现在管理面板。我注册了它:

from django.contrib import admin
from apps.account.models import RestrictedUsername

class RestrictedUsernameAdmin(admin.ModelAdmin):
    list_display = ('username',)
    search_fields = ('username',)

admin.site.register(RestrictedUsername, RestrictedUsernameAdmin)

有什么想法可以让它工作吗?

您的帐户应用程序是否列在已安装的应用程序中?您是否也运行了python manage.py syncdb?