mongodb에서 데이터 불러오기
<script>
function show_info() {
$(".team-name").on('click', function (e) {
let value = e.target.id
console.log(value)
fetch('/input').then(res => res.json()).then(data => {
let rows = data['result'];
rows.forEach((a) => {
let name = a['name'];
let mbti = a['mbti'];
let hobby = a['hobby'];
let merit = a['merit'];
let style = a['style'];
let blog = a['blog'];
if (value === name) {
$('#controls').empty();
let temp_html =``
$('#controls').append(temp_html);
}
});
})
}
)
}
team-name이라는 class를 가진 버튼에서 id값을 가져온 후
데이터에 담긴 name 중에서 같은 값이 있을 때 html로 변환
<python>
@app.route("/input", methods=["GET"])
def bucket_get():
all_info = list(db.introduce.find({},{'_id':False}))
return jsonify({'result': all_info})
Flask
render_template 기능은 templates에 있는 파일만 읽을 수 있으므로
redirect도 import해서 사용해야됨!
def home():
return redirect('/static/html/subpage.html')
Git 브랜치
git 브랜치: 가져오기, 합치기, 삭제하기
이번에는 git의 브랜치 관련 명령들을 알아보겠습니다. 브랜치는 동일한 소스를 기반에서 다양한 버전을 만들어 낼 수 있는 기능으로, 여러 사람이 동시에 작업을 하거나, 조금씩 다른 버전을 만
yztech.tistory.com