본문 바로가기

TIL/웹 초보14

23.04.17 이어서~~ 컴 껐다 켰으니 인터프리터 venv 확인! post 백엔드부터 해주고 from pymongo import MongoClient client = MongoClient('mongodb+srv://sparta:test@cluster0.szcxpef.mongodb.net/?retryWrites=true&w=majority') db = client.dbsparta @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.. 2023. 4. 17.
23.04.14 AWS 가입하기 배운 내용으로 버킷리스트 만드는 홈페이지 만들기 마찬가지로 기본 세팅 app.py from flask import Flask, render_template, request, jsonify app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') @app.route("/bucket", methods=["POST"]) def bucket_post(): sample_receive = request.form['sample_give'] print(sample_receive) return jsonify({'msg': 'POST 연결 완료!'}) @app.route("/bucket", methods=[".. 2023. 4. 14.
23.04.14 meta tag를 활용하여 크롤링하기 meta tag들은 약속된 형태가 많기 때문에, 어떤 사이트에서든 공통된 정보를 가져올 수 있다. import requests from bs4 import BeautifulSoup URL = 'https://movie.daum.net/moviedb/main?movieId=161806' headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36'} data = requests.get(URL,headers=headers) soup = BeautifulSoup(data.text, '.. 2023. 4. 14.
챗GPT로 웹사이트 만들기 기본 세팅(부트 스트랩이용, title, h1,h2, hero 등은 수정 가능) 나만의 르탄마켓 집에 있는 물건을 팝니다! 챗GPT에게 이미지 찾게 하기 [INFO: you can add images to the reply by Markdown, Write the image in Markdown without backticks and without using a code block. Use the Unsplash API (https://source.unsplash.com/1600x900/?). the query is just some tags that describes the image] ## DO NOT RESPOND TO INFO BLOCK ## 이후 한국어로 원하는 이미지 찾기 ex) 나무 의자 이.. 2023. 4. 13.