본문 바로가기

Python_WEB/Project-Noticeboard

(13)
[Django]Board > Templates > HTML > Board Write {% extends "base.html" %} {% block contents %} {% csrf_token %} {% for field in form %} {{ field.label }} {{ field.field.widget.name }} {% ifequal field.name 'contents' %} {% else %} {% endifequal %} {% if field.errors %} {{ field.errors }} {% endif %} {% endfor %} 글쓰기 돌아가기 {% endblock %}
[Django]Board > Templates > HTML > Board List {% extends "base.html" %} {% block contents %} # 제목 아이디 일시 {% for board in boards %} {{ board.id }} {{ board.title }} {{ board.writer }} {{ board.registered_dttm }} {% endfor %} {% if boards.has_previous %} 이전으로 {% else %} 이전으로 {% endif %} {{ boards.number }} / {{ boards.paginator.num_pages }} {% if boards.has_next %} 다음으로 {% else %} 다음으로 {% endif %} 글쓰기 {% endblock %}
[Django]Board > Templates > HTML > Board_Detail {% extends "base.html" %} {% block contents %} 제목 내용 {{ board.contents }} 태그 {{ board.tags.all|join:"," }} 돌아가기 {% endblock %} 1. {% extends %} 확장 템플릿 태그를 사용하여 어떤 Base 템플릿을 사용하는지 지정 2. {{ board.tags.all|join:"," }} board.tags.all은 해당 게시글에 속하는 모든 태그들을 QuerySet으로 가져옵니다. QuerySet에 대하여, join(',') 명령어를 수행할 수 있도록 템플릿 엔진을 제공.
[Django]Board > Templates > HTML > Basic [ 템플릿 상속 Basic HTML ] {% block contents %} {% endblock %} [ Bootstrap ]
[Django]Design Proposal [ Directory Structure ] [ Design ] [ Reference Deployment Site ] http://ankiwoong.pythonanywhere.com/ http://ankiwoong.pythonanywhere.com/ ankiwoong.pythonanywhere.com