본문 바로가기

스파르타 코딩 웹개발 종합반57

5-1 배울것 & 파일질라/가비아 설치 이번주 배울것 ✔️ 버킷리스트 프로젝트 만들기 ✔️ 팬명록 클라우드환경에 배포 - url을 공유가능 Filezila (클라우드환경에 올릴수있게 파일을 보내주는 프로그램) https://filezilla-project.org/download.php Download FileZilla Client for Windows (64bit x86) Download FileZilla Client for Windows (64bit x86) The latest stable version of FileZilla Client is 3.59.0 Please select the file appropriate for your platform below. Prerelease versions To download the latest p.. 2022. 5. 26.
4-14 4주차 마무리 연습_ 팬명록 1) 응원 남기기(POST): 정보 입력 후 '응원 남기기' 버튼클릭 시 주문목록에 추가 2) 응원 보기(GET): 페이지 로딩 후 하단 응원 목록이 자동으로 보이기 완성본: http://spartacodingclub.shop/web/homework 완성코드: app.py from flask import Flask, render_template, request, jsonify app = Flask(__name__) from pymongo import MongoClient client = MongoClient("내 URL") db = client.sparta @app.route('/') def home(): return render_template('index.html') @app.route("/homew.. 2022. 5. 23.
4-13 [스파르타피디아] - GET 연습(보여주기) 화면을 새로고침 했을 때, DB에 저장된 리뷰가 화면에 올바르게 나타나는지 확인 1. 요청 정보 : URL= /mars, 요청 방식 = GET 2. 클라이언트(ajax) → 서버(flask) : 없음 3. 서버(flask) → 클라이언트(ajax) : 전체 영화를 보내주기 먼저, 클라이언트와 서버 확인하기 서버코드-app.py @app.route("/mars", methods=["GET"]) def mars_get(): return jsonify({'msg': 'GET 연결 완료!'}) 클라이언트 코드-index.html $(document).ready(function () { show_order(); }); function show_order() { $.ajax({ type: 'GET', url: '/.. 2022. 5. 21.
4-12 [스파르타피디아] - POST 연습(포스팅하기) API 만들고 사용하기 - 포스팅API (Create →POST) 1. 요청 정보 : URL= /movie, 요청 방식 = POST 2. 클라이언트(ajax) → 서버(flask) : url, star, comment 3. 서버(flask) → 클라이언트(ajax) : 메시지를 보냄 (포스팅 완료!) 먼저, 클라이언트와 서버 연결 확인 서버코드-app.py @app.route("/movie", methods=["POST"]) def movie_post(): sample_receive = request.form['sample_give'] print(sample_receive) return jsonify({'msg':'POST 연결 완료!'}) 클라이언트 코드 -index.html function posti.. 2022. 5. 21.