바뀜

178번째 줄: 178번째 줄:  
아래 작업은 DB 반영이 끝나 후에 진행해야 한다. 그렇지 않으면 <code>ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'account.user', but app 'account' isn't installed.</code> 따위의 에러가 발생한다.
 
아래 작업은 DB 반영이 끝나 후에 진행해야 한다. 그렇지 않으면 <code>ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'account.user', but app 'account' isn't installed.</code> 따위의 에러가 발생한다.
   −
보통은 앱이름은 account, 모델이름은 User 따위가 된다.<syntaxhighlight lang="python">
+
다음과 같은 줄을 settings.py 내에 추가한다.
 +
 
 +
보통은 앱이름은 custom_account, 모델 이름은 User 따위가 된다.<syntaxhighlight lang="python">
 
AUTH_USER_MODEL = 'custom_account.User'  # 관리유저로 사용할 모델을 설정한다.
 
AUTH_USER_MODEL = 'custom_account.User'  # 관리유저로 사용할 모델을 설정한다.
 
</syntaxhighlight>
 
</syntaxhighlight>
184번째 줄: 186번째 줄:  
=== 중간 확인 ===
 
=== 중간 확인 ===
   −
* python manage.py createsuperuser로 관리계정 생성.
+
* python manage.py createsuperuser로 관리 계정 생성.
 
* 사이트를 실행시킨 후 /admin에 들어가 로그인해본다.
 
* 사이트를 실행시킨 후 /admin에 들어가 로그인해본다.
   196번째 줄: 198번째 줄:  
     list_display = ('identifier',)
 
     list_display = ('identifier',)
 
     exclude = ('password',)  # 사용자 상세 정보에서 비밀번호 필드를 노출하지 않음
 
     exclude = ('password',)  # 사용자 상세 정보에서 비밀번호 필드를 노출하지 않음
</syntaxhighlight>그럼 이제 이 모델로 계정관리가 가능해진다.
+
</syntaxhighlight>그럼 이제 이 모델로 계정 관리가 가능해진다.
    
==폼 작성==
 
==폼 작성==