본문 바로가기

전체 글191

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.
23.04.13 dbmongo 기본 세팅 pip install pymongo, pip install dnspython from pymongo import MongoClient client = MongoClient('mongodb+srv://sparta:test@cluster0.szcxpef.mongodb.net/?retryWrites=true&w=majority') db = client.dbsparta # dbsparta라는 큰 그룹 만들기 데이터 관리 # 저장 - 예시 doc = {'name':'bobby','age':21} db.users.insert_one(doc) # 한 개 찾기 - 예시 user = db.users.find_one({'name':'bobby'}) # 여러개 찾기 - 예시 ( _id 값은 제외하고.. 2023. 4. 13.