필드명 |
타입 |
제약 조건 |
설명 |
id |
Integer |
PK, Auto Increment |
기본 키 |
title |
CharField(50) |
|
포스트 제목 |
slug |
SlugField |
Unique |
포스트 제목 별칭 |
descriptiton |
CharField(100) |
Blank |
포스트 내용 한줄 설명 |
content |
TextField |
포스트 내용 기록 |
|
create_date |
DateTimeField |
auto_now_add |
포스트를 생성한 날짜 |
modify_date |
DateTimeField |
auto_now |
포스트를 수정한 날짜 |
URL 패턴 |
VIEW 이름 |
template 파일명 |
/blog/ |
PostLV(ListView) |
post_all.html |
/blog/post/ |
PostLV(ListView) |
post_all.html |
/blog/post/django-example/ |
PostDV(DetailView) |
post_detail.html |
/blog/archive/ |
PostAV(ArchiveIndexView) |
post_archive.html |
/blog/2016/ |
PostYAV(YearArchiveView) |
post_archive_year.html |
/blog/2016/dec/ |
PostMAV(MonthArchiveView) |
post_archive_month.html |
/blog/2016/dec/12/ |
PostDAV(DayArchiveView) |
post_archive_day.html |
/blog/today/ |
PostTAV(TodayArchiveView) |
post_archive_day.html |
/admin/ |
django 제공 기능 |
|
작업순서 |
관련 명령/파일 |
필요한 작업내용 |
뼈대 만들기 |
startproject |
|
|
settings.py |
|
|
migrate |
|
|
createsuperuser |
|
|
startapp |
|
|
settings.py |
|
|
|
|
모델 코딩하기 |
models.py |
모델(테이블) 정의 |
|
admin.py |
Admin 페이지에 모델 등록 |
|
makemigrations |
모델 정의 파일 생성 |
|
migrate |
모델을 데이터베이스에 반영 |
|
|
|
URLconf 코딩하기 |
urls.py |
URL 정의 |
|
|
|
view 코딩하기 |
views.py |
view 로직 작성 |
|
|
|
template 코딩하기 |
templates 디렉토리 |
html 파일 작성 |
|
|
|
그 외 코딩하기 |
- |
- |
|
|
|