분류 전체보기60 "창" 4주 클론코딩 2022. 2. 26. 그림파일들 2022. 1. 5. Javascript -JQUERY 입문 Seoul Javascript 코드가 길어지면 너무 지저분하겠다. $('#photo').attr('src','images/seoul.png') attr : attribute : 속성을 바꾼다. -> png로! function clickSeoul() { $('#photo').attr('src','images/seoul.png'); $('#seoul').css('font-weight', 'bold'); $('#home').css('font-weight', 'normal'); $('#tokyo').css('font-weight', 'normal'); $('#paris').css('font-weight', 'normal'); } 이벤트 event : HTML요소들에게 일어날 수 있는 일들 예 ) 사용자가 요소를.. 2022. 1. 4. 5주차(3) POST 연습- 완료하기, done 요청정보 : URL = /bucket/done, 요청방식 = POST 클라이언트(ajax) -> 서버(flask) : num (버킷넘버) 서버(flask) -> 클라(ajax) : 메시지 보냄 (버킷 완료!) 1. 클라이언트(ajax)와 서버(flask)연결 확인하기 2. 서버부터 만들기 3. 클라이언트 만들기 4. 완성하기 @app.route("/bucket/done", methods=["POST"]) def bucket_done(): num_receive = request.form['num_give'] return jsonify({'msg': 'POST(완료) 연결 완료!'}) 우리는 num_give로 데이터를 받아와서 num_receive로 정의하고 이걸 업데이트 해야지. 어떻게? list 형식을 .. 2022. 1. 4. 5주차(2) GET 서버 만든 뒤 내려받기! #1. Console.log()로 먼저 데이터 확인해보기. 0: {bucket: '데이터전송', done: 0, num: 1} - - - 4: {bucket: '돈벌기', done: 0, num: 5} length: 5 let bucket = $('#bucket').val() 들어간 내용 살펴보면 - row의 순서: { 'bucket'=bucket_receiver ;; 'num' = count ;; 'done' = 0} '$('#bucket').val() : id = bucket 이라는 html 항목에 입력된 값을 bucket이라고 정의해서 이 값을 $.ajax({ type: "POST", url: "/bucket", data: {bucket_give:bucket}, success: function (r.. 2022. 1. 4. 5주차(1) POST 후 GET 서버 만들기 까 파일질라 --> 웹사이트에 파일을 올리는 것을 보조하는 프로그램 가비아 --> 도메인 구매 ! www.mypainadvisor.shop 버킷리스트 만들기!! #1. 프로젝트 / 설정 - 패키지 설치 (flask, dnspython, pymongo, bs4, requests, beautifulsoup4) #2. 항상 잘 진행되는지 확인! #3. 여기는 기록하기 누르면 해당 내용을 서버로 전달!! ** 이때 중요한 건 나중에 완료! 누르면 삭제되는 기능을 넣어야되니, 각 기록에 대한 번호를 매겨줘야한다. ** doc { #1. 번호 #2. 내용 #3.진행 되었는지!} @app.route("/bucket", methods=["POST"]) def bucket_post(): bucket_receive = req.. 2022. 1. 3. 4주차 - 화성땅 공동구매 새 프로젝트 -> MARS 폴더 -> 폴더에 3개 추가 : static / templates / app.py -> 설정으로 들어가서 패키지 추가 : flask(서버 연결) / pymongo(DB연결) / dnspython(python 꾸미기) app.py / index.html : 내용 입력 --> flask 쓸 때 templates 폴더 안에 html 들어가야 된다고 지난 강의에서도 설명 했었다. static : style, css / templates : html / app.py **mongodb atlas 띄워두기. ============================================================================ ** POST 연습 ; 주문 저장 1. 요청정보.. 2021. 12. 29. 4주차 (2) POST 요청 API코드 앞으로는 post에서 많이 데이터 가져간다. --> 1) title_give로 '봄날은간다' 입력 @app.route('/test', methods=['GET']) def test_get(): title_receive = request.args.get('title_give') print(title_receive) return jsonify({'result': 'success', 'msg': '이 요청은 GET!'}) @app.route('/test', methods=['POST']) def test_post(): title_receive = request.form['title_give'] print(title_receive) return jsonify({'result':'succ.. 2021. 12. 29. 이전 1 2 3 4 ··· 8 다음