django2 2일차

박예원·2023년 8월 29일

23. Bootstrap을 이용한 Form 디자인 정리

bootstrap
1. bootstrap4 설치
2. settings.py에 bootstrap4 적기
3. login.html form을 {% bootstrap_form form %} 로 바꾸기

body 글꼴
1. 네이버에서 글꼴 다운
2. static에서 fonts디렉토리 만들고 파일 붙여넣기
3. head.html에 링크 추가
4. base.html에서 body style에 폰트 추가


24. DetailView를 이용한 개인 페이지 구현

  1. views.py에 class AccountDetailView 추가
  2. detail.html 만들기
  3. urls.py에 path 추가
  4. header.html에 detail(MyPage) 추가


25. UpdateView를 이용한 비밀번호 변경 구현

  1. view.py에 class AccountUpdateView 추가
  2. url.py에 경로 추가
  3. uccountapp에 update.html 만들기
  4. detail.html에 들어간 유저가 현재 유저와 같을 시 수정하게 하는구문 추가
  5. uccountapp에 forms.py 만들기(self.fields ['username'].disabled = True 필수)

멍청실수

  1. venv 밑에 detail.html 만들고 한참헤멤
  2. 뛰어쓰기 오류
  3. templates안에 forms.py 만들고 한참헤멤

++
A user with that username already exists. 에러가 자꾸떠서
https://www.inflearn.com/questions/852404/updateform-a-user-with-that-username-already-exists-%EC%97%90%EB%9F%AC
이렇게 변경

profile
안녕하세요.

0개의 댓글