django2 3일차

박예원·2023년 8월 30일

26. DeleteView 기반 회원탈퇴 구현

DeleteView
1. views.py에 class AccountDeleteView 추가
2. accountapp에 delete.html 만들기, btm-danger(빨간색)으로 변경
3. urls.py에 delete 경로 추가
4. detail.html에 delete 경로 추가

빠뜨린것
header.html에 SignUp 추가


27. Authentication 인증시스템 구축

수정
views.py에 target_user 추가
update.html이랑 delete.html에서 user -> target_user
yewon/urls.py에서 account -> accounts

Authentication
1. views.py에 인증과정 추가(로그인 되어있어야 hello_world 들어갈수있음)
2. 로그인 되어있어야 수정, 탈퇴할수있도록 변경
문제점: 다른사람의 계정도 수정, 탈퇴할 수 있음
4. 요청유저와 접속유저가 일치해야함 추가

profile
안녕하세요.

0개의 댓글