
localhost:5000 버킷리스트 목록이 기존리스트 지워지고 새로운 리스트 나와야 하는데 안나와요. 다시 한번 코딩 확인 부탁드립니다.
몽고디비에 데이터는 올라가있는데요. get이 잘 안됩니다.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap" rel="stylesheet" />
<title>인생 버킷리스트</title>
<style>
* {
font-family: "Gowun Dodum", sans-serif;
}
.mypic {
width: 100%;
height: 200px;
background-image: linear-gradient(0deg,
rgba(0, 0, 0, 0.5),
rgba(0, 0, 0, 0.5)),
background-position: center;
background-size: cover;
color: white;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.mypic>h1 {
font-size: 30px;
}
.mybox {
width: 95%;
max-width: 700px;
padding: 20px;
box-shadow: 0px 0px 10px 0px lightblue;
margin: 20px auto;
}
.mybucket {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.mybucket>input {
width: 70%;
}
.mybox>li {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-bottom: 10px;
min-height: 48px;
}
.mybox>li>h2 {
max-width: 75%;
font-size: 20px;
font-weight: 500;
margin-right: auto;
margin-bottom: 0px;
}
.mybox>li>h2.done {
text-decoration: line-through;
}
</style>
<script>
$(document).ready(function () {
show_bucket();
});
function show_bucket() {
fetch('/bucket').then(res => res.json()).then(data => {
let rows = data['result']
$('#bucket-list').empty()
rows.forEach((a) => {
let bucket = a['bucket']
let temp_html = `<li>
<h2>✅ ${bucket}</h2>
</li>`
$('#bucket-list').append(temp_html)
})
})
}
function save_bucket() {
let bucket = $('#bucket').val()
let formData = new FormData();
formData.append("bucket_give", bucket);
fetch('/bucket', { method: "POST", body: formData, }).then((response) => response.json()).then((data) => {
alert(data["msg"]);
window.location.reload();
});
}
</script>
</head>
<body>
<div class="mypic">
<h1>나의 버킷리스트</h1>
</div>
<div class="mybox">
<div class="mybucket">
<input id="bucket" class="form-control" type="text" placeholder="이루고 싶은 것을 입력하세요" />
<button onclick="save_bucket()" type="button" class="btn btn-outline-primary">기록하기</button>
</div>
</div>
<div class="mybox" id="bucket-list">
<li>
<h2>✅ 호주에서 스카이다이빙 하기</h2>
</li>
</div>
</body>
</html>
File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 232, in serve_forever.py", line 232, in serve_forever
ready = selector.select(poll_interval) ", line 323, in select
File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\selectors.py", line 323, in select ", line 314, in _select
r, w, _ = self._select(self._readers, self._writers, [], timeout)
File "C:\Users\PC\AppData\Local\Programs\Python\Python38\lib\selectors.py", line 314, in _select
r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] 소켓 이외의 개체에 작업을 시도했습니다
* Restarting with stat
* Debugger is active!
* Debugger PIN: 116-791-652
127.0.0.1 - - [21/Apr/2023 13:53:04] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:53:04] "GET /bucket HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:53:13] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:53:13] "GET /bucket HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:53:14] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:53:14] "GET /bucket HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:55:01] "POST /bucket HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:55:03] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Apr/2023 13:55:03] "GET /bucket HTTP/1.1" 200 -
고 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.
