작정하고 장고 _ 5/12

seoyeon·2023년 5월 12일
0

UDR

목록 보기
30/42

25강_UpdateView를 이용한 비밀번호 변경 구현

C - R - Update - D

  • 업데이트도 create와 파라미터가 거의 비슷
  • 페이지 주인이 본인 수정 페이지로 갈 수 있는 링크 : detail에서 수정
{% 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


26강_DeleteView 기반 회원탈퇴 구현

C - R - U - Delete

Quit 제출 시 유저정보 삭제

profile
안녕하세용

0개의 댓글

관련 채용 정보