Django模型注册/注销不使用配置文件

Django模型注册/注销不使用配置文件,django,django-models,django-admin,Django,Django Models,Django Admin,嗨,我在django网站上使用Userena用户系统。当我在本地测试项目时,一切都正常,当我部署它时,问题就出现了 I have the following model: from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from userena.models import UserenaB

嗨,我在django网站上使用Userena用户系统。当我在本地测试项目时,一切都正常,当我部署它时,问题就出现了

I have the following model:

from django.db import models
from django.contrib.auth.models import User  
from django.utils.translation import ugettext as _  
from userena.models import UserenaBaseProfile  

class Profile(UserenaBaseProfile):
    user = models.OneToOneField(User, unique=True, verbose_name=_('user'), related_name='my_profile')
和下面的管理员注册

从django.contrib导入管理 从帐户将模型导入为acc

class ProfileAdmin(admin.ModelAdmin):
    filter_horizontal = ('spoken_languages','favourite_houses','sports')
    fields = ('user','nationality','spoken_languages','smoker','gender','favourite_houses','birthday','school','course','program','sports','housing_status','something_to_say')


admin.site.register(acc.Profile, ProfileAdmin)
(请注意,我没有包括原始模型中的所有字段)

这在runserver开发中运行良好。但当我部署它时,我会收到一个错误,告诉我配置文件已经注册了。我试着添加这一行

admin.site.unregister(acc.Profile)
在此之前,但随后错误是配置文件未注册

我在某个地方读到过对admin.autodiscover()的评论,但这会使我的管理站点崩溃

有什么想法吗?谢谢

“看起来userena已经为您注册了配置文件模型”


实际上,

在评论中回答了这一问题,看起来
userena
已经为您注册了配置文件模型,请看是的,就是这样,谢谢!我不能接受你的回答是正确的,因为这是一个评论!我刚刚给了你一票,所以现在你有足够的声誉,所以你可以接受你的答案:)