- Django를 활용한 서비스 제작
- DB에 대한 이해
- 메인페이지
- CRUD 구현
- 로그인 및 회원가입
App Name | Views Function | HTML File | Remarks |
---|---|---|---|
main | index | index.html | / |
about | about.html | /about/ | |
index | index.html | /contact/ | |
blog | blog_list | blog_list.html | /blog/ |
blog_details | blog_details.html | /blog/<int:pk> | |
blog_write | blog_write.html | /blog/write/ | |
blog_edit | blog_edit.html | /blog/edit/<int:pk>/ | |
blog_delete | blog_delete.html | /blog/delete/<int:pk>/ | |
accounts | login | login.html | /login/ |
logout | /logout/ | ||
signup | signup.html | /signup/ | |
profile | profile.html | /profile/ |
accounts/
├─ admin.py
├─ apps.py
├─ forms.py
├─ models.py
├─ urls.py
├─ views.py
├─ tests.py
└─ __init__.py
blog/
├─ admin.py
├─ apps.py
├─ forms.py
├─ models.py
├─ tests.py
├─ urls.py
├─ views.py
└─ __init__.py
config/
├─ asgi.py
├─ settings.py
├─ urls.py
├─ wsgi.py
└─ __init__.py
main/
├─ admin.py
├─ apps.py
├─ models.py
├─ tests.py
├─ urls.py
├─ views.py
└─ __init__.py
templates/
├─ accounts/
│ ├─ login.html
│ ├─ profile.html
│ └─ signup.html
├─ blog/
│ ├─ post_detail.html
│ ├─ post_list.html
│ ├─ post_form.html
│ ├─ post_delete.html
│ ├─ comment_form.html
│ └─ bloglist.html
└─ main/
├─ about.html
├─ index.html
└─ contact.html
gantt
title Django Blog Project
dateFormat YYYY-MM-DD
section 기획 및 설계
URL 구조 기획 : 2024-03-07, 1d
DB 테이블 구조 기획 : 2024-03-07, 1d
WBS 생성 :2024-03-08 , 1d
ERD 생성 : 2024-03-08, 1d
section 요구사항 분석
Bolg 구성 기능 분석 :2024-03-08 , 1d
section 구현
CRUD 기능 구현 : 2024-03-09 , 1d
로그인/회원가입 기능 구현 : 2024-03-09 , 1d
추가 기능 구현 : 2024-03-010 , 1d
section UI
BootStrap 사용 : 2024-03-11 , 1d
와이어프레임 제작 : 2024-03-11 , 1d
section 테스트 및 배포
테스트 : 2024-03-12 , 1d
배포 : 2024-03-12 , 1d
메인 화면 | 설명 |
---|---|
![]() |
|
회원 가입 | 설명 |
---|---|
![]() |
|
로그인 | 설명 |
---|---|
![]() |
|
목록 | 설명 |
---|---|
![]() |
|
목록 | 설명 |
---|---|
![]() |
|
목록 | 설명 |
---|---|
![]() |
|
프로필 | 설명 |
---|---|
![]() |
|
커스텀 유저를 만들어 사용할 때 django.db.utils.IntegrityError: UNIQUE constraint failed: accounts_customuser.nickname 라는 nickname 필드에 대한 유니크 제약조건을 위반했다는 오류가 계속 발생
해결방법으로
- 장고 모델에 있는 AbstractUser의 클래스에 아래 코드들을 추가.
- CustomUser 필드에 email과 nickname을 회원가입 시에 기입하도록 변경
email = models.EmailField(_("email address"), blank=True, unique=True)
nickname = models.CharField(max_length=50, unique=True)
ERD와 URL 구조를 먼저 정리하는 것의 중요성을 깨닫게 되었습니다. 코드를 작성하면서 구조를 형성하려고 했으나, 구조의 혼란으로 인해 오히려 시간을 낭비하게 되었습니다. 이러한 경험을 통해, 프로젝트를 시작하기 전에 명확한 데이터 모델과 URL 구조를 설계하는 것이 중요하다는 것을 깨닫게 되었습니다.