2013-08-02 2 views
1

안녕하세요 저는 장고 웹 사이트의 Userena 사용자 시스템을 사용하고 있습니다. 로컬로 프로젝트를 테스트 할 때 모든 것이 잘 작동하므로 배포 할 때 문제가 발생합니다. Django 모델 등록/등록 취소가 프로필과 작동하지 않습니다.

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) 

(I 원본에서 모든 필드를 포함하지 적이 있습니다 모델).

이것은 개발 runserver에서 잘 작동합니다. 그러나 배포 할 때 프로필이 이미 등록되었다는 오류 메시지가 나타납니다. 나는이 라인을 추가하려고 시도했다. 그 전에이 라인을 추가하려고 시도했다. 그러나 그 전에는 프로파일이 등록되지 않았다는 에러가 난다.

admin.autodiscover()에 댓글을 달기 위해 어딘가 읽었지만 내 관리 사이트가 손상됩니다.

아이디어가 있으십니까? 당신은 [여기]를 참조과

+1

것 같은데 의해 코멘트에 대답 "userena 것 같은데 이미 당신이 here 볼에 대한 프로파일 모델을 등록"'userena' 이미 프로필 모델을 등록 (https://github.com/bread-and-pepper/django-userena/blob/master/userena/admin.py#L24) –

+0

예, 감사합니다! 내가 정확한 답을 받아 들일 수 없습니다. –

+0

방금 ​​upvote 준 그래서 지금 당신은 [자신의 질문에 대답] (http://stackoverflow.com/help/self-answer) 수 있으며 귀하의 답변을 수락 충분한 명성을 가지고 :) –

답변

관련 문제