C - R - Update - D
{% if target_user == user %}
<a href="{% url 'accountapp:update' pk=user.pk %}">
<p>
Change Info
</p>
</a>
{% endif %}
▶ 비밀번호와 함께 아이디도 변경 가능, 아이디를 못 바꾸게 설정해야함! - 새로운 forms.py 생성
from django.contrib.auth.forms import UserCreationForm
class AccountUpdateForm(UserCreationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['username'].disabled = True
C - R - U - Delete
Quit 제출 시 유저정보 삭제