
5주차 강의내용 중 팬페이지 만든후 AWS 서버를 구매한 후 업로드 하는 과정에서 터미널 상에는 문제가 없는 것으로 뜨나 AWS 업로드 상황을 보면 servere로 뜹니다. 이전 즉문즉답 질문주신 분꺼를 보면서 했는데 진척이 없습니다. ".e~"라는 이름 긴 파일 지우고 ed logs 입력시 bash: ed: command not found 로 뜨는데 deploy로 잡고 하라는 내용대로 cd deploy 붙여넣고 재차 ed logs 입력시
ERROR: This directory has not been set up with the EB CLI
You must first run "eb init". 로 진행이 멈춘 상태입니다. 중간에 requirements에 다른 값(튜터님이 적어주신 답변사항 있음)을 적어 저장하였는데 변화가 없는 상태입니다. 코드는 뭘 복사해서 넣어야 하는지 몰라서 어플리케이션 코드를 붙여넣었습니다.


from flask import Flask, render_template, request, jsonify
application = app = Flask(__name__)
from pymongo import MongoClient
import certifi
ca = certifi.where()
client = MongoClient('mongodb+srv://sparta:003202@cluster0.sxba111.mongodb.net/?retryWrites=true&w=majority',tlsCAFile=ca)
db = client.dbsparta
@app.route('/')
def home():
return render_template('index.html')
@app.route("/guestbook", methods=["POST"])
def guestbook_post():
name_receive = request.form['name_give']
comment_receive = request.form['comment_give']
doc = {
'name':name_receive,
'comment':comment_receive
}
db.fan.insert_one(doc)
return jsonify({'msg': '저장 완료!'})
@app.route("/guestbook", methods=["GET"])
def guestbook_get():
all_comments = list(db.fan.find({},{'_id':False}))
return jsonify({'result': all_comments})
if __name__ == '__main__':
app.run()
