Pet-Project-web-clone-board-add

개요

웹에 클론코딩 페이지를 추가하기까지의 정리

현황

main
[게시판으로 가는 기능 추가]

current
[게시판 페이지 추가]

추가 내용

main/clone_board.py 추가
template/main/clone_board.html 추가

clone_board.html 코드

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{% extends 'main/clone_base.html' %}
{% block content %}

<html>
<body>
<div class="container my-3">
<table class="table">
<thead>
<tr class="thead-dark">
<th>번호</th>
<th>내용</th>
<!--th>작성일시</th!-->
</tr>
</thead>
<tbody>
{% if content_list %}
{% for content in content_list %}
<tr>
<td>{{ loop.index }}</td>
<td>
{{ content['board_content'] }}
</tr>

{% endfor %}
{% else %}
<tr>
<td colspan="3">너에게 받은만큼 더 행복해질게</td>
</tr>
{% endif %}
</tbody>
</table>
</div>

</body>
</html>


{% endblock %}

clone_board.html 설명

  • clone_board.py 파일에서 데이터베이스에서부터 입력한 내용 (board_content_list)을 가져와
    html에 전달해주고 이를 모두 출력한다.
    (참고 사이트 : https://wikidocs.net/81050)

앞으로 추가할 것

  1. 기능 손보기
    1. 글쓴 시간 추가
    2. 디자인 수정(부트스트랩 변경 예상)
  2. 글쓰기
  3. 수정
  4. 삭제
  5. 사진 업로드 기능
Author

Praisebak

Posted on

2021-06-08

Updated on

2021-06-07

Licensed under

Comments