
안녕하세요, 어제 MongoDB에 넣는 방법까지는 알았고, Python에서 불러일으키는 방법까지도 알아냈습니다.
다만,
from flask import Flask, render_template, request, url_for, jsonify
from pymongo import MongoClient
import certifi
app = Flask(__name__)
ca = certifi.where();
client = MongoClient('mongodb+srv://test:sparta@cluster0.q6ciqun.mongodb.net/?retryWrites=true&w=majority', tlsCAFile=ca)
db = client.test
user = db.fs.files.find_one({'filename':"CP_0001.pdf"})
print(user)
이런 식으로 출력을 해보니, Python에서 Dictionary 형태로 주던데, 이것을 HTML에다가 어떻게 src를 달아야 하는걸까요? 이게 MongoDB의 특징인지, 아니면 보통 다른 SQL에서도 그러한지 궁금합니다.
<h1> 제목입니다. </h1>
<img src="...">
혹은 <iframe src="..."> 이 두 ...에다가 어떻게 넣어야하는건지 알고 싶습니다. 수업 중에 있는 내용들은 jsonify해서 그냥 text만 불러오면 되는것이라 쉽게 좇아할 수 있는데, 제가 구현하고 싶은 것은 db 안에 있는 이미지 혹은 pdf 파일을 불러오는 것이라, 꼭 알고 싶습니다!
