바뀜

둘러보기로 가기 검색하러 가기
34번째 줄: 34번째 줄:     
===settings.py에 만들 모델 추가===
 
===settings.py에 만들 모델 추가===
보통은 앱이름은 account, 모델이름은 MyUser, Account, CustomUser, User 따위가 된다.<syntaxhighlight lang="python">
+
보통은 앱이름은 account, 모델이름은 User 따위가 된다.<syntaxhighlight lang="python">
AUTH_USER_MODEL = '앱이름.모델이름'  # 관리유저로 사용할 모델을 설정한다.
+
AUTH_USER_MODEL = 'account.User'  # 관리유저로 사용할 모델을 설정한다.
    
</syntaxhighlight>
 
</syntaxhighlight>
181번째 줄: 181번째 줄:  
class UserAdmin(admin.ModelAdmin):
 
class UserAdmin(admin.ModelAdmin):
 
     list_display = ('identifier')
 
     list_display = ('identifier')
    list_display_links = ('identifier')
   
     exclude = ('password',)  # 사용자 상세 정보에서 비밀번호 필드를 노출하지 않음
 
     exclude = ('password',)  # 사용자 상세 정보에서 비밀번호 필드를 노출하지 않음
 
</syntaxhighlight>그럼 이제 이 모델로 계정관리가 가능해진다.
 
</syntaxhighlight>그럼 이제 이 모델로 계정관리가 가능해진다.

둘러보기 메뉴