본문 바로가기

전체 글

(133)
타임리프 href URL 링크 basic url basic url hello queryparam path variable path variable + query parameter
리눅스 서버 세팅 1. AWS EC2 인스턴스 생성 https://ap-northeast-2.console.aws.amazon.com/ec2/v2/home?region=ap-northeast-2 https://ap-northeast-2.console.aws.amazon.com/ec2/v2/home?region=ap-northeast-2 ap-northeast-2.console.aws.amazon.com 인스턴스 탭에서 인스턴스 시작 클릭 여기까지 했다면, 우측에 인스턴스 시작을 클릭해주세요 접속 테스트 #자신의 인스턴스 주소 알아내기 ssh -i {자신의 키페어 파일 경로}/{자신의키페어이름}.pem ubuntu@{자신의 인스턴스 ipv4주소} ex)ssh -i /C/AWS/ubuntu_test.pem ubuntu@111..
클라우드 배포 준비 1. FileZilla 다운로드 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.60.1 Please select the file appropriate for your platform below. Please select your edition of FileZilla Client FileZilla FileZilla with manual FileZilla P filezilla-project.org - 설치할 때...
AWS 윈도우 외부 접속이 안되는가? 이 글을 봐라 보안규칙을 아래와 같이 해라! 윈도우 서버에서 당신이 사용하는 포트(아마 8080일 것이다)를 인바운드 규칙에 추가해라! 보안규칙에서 허용한다고 다가 아니다. 윈도우 서버 자체 내에서도 열어줘야한다! 정말 이상하지 않은가?
Flask 기본 세팅 Flask 기본 라이브러리, DB 라이브러리 템플릿 리턴시 리턴 방법 data 리턴시 리턴 방법 from flask import Flask, render_template, request, jsonify #기본 라이브러리들 from pymongo import MongoClient #디비 연결 라이브러리 #연결 client = MongoClient('mongodb+srv://:@cluster0.zlqekaz.mongodb.net/?retryWrites=true&w=majority') #dbsparta라는 db 있으면 연결 없으면 생성 후 연결 db = client.dbsparta app = Flask(__name__) @app.route('/') def home(): return render_template..
몽고디비 crud from pymongo import MongoClient #연결 client = MongoClient('mongodb+srv://:@cluster0.zlqekaz.mongodb.net/?retryWrites=true&w=majority') #dbsparta라는 db 있으면 연결 없으면 생성 후 연결 db = client.dbsparta # 저장 - 예시 doc = {'name':'bobby','age':21} db.users.insert_one(doc) #db의 users테이블에 삽입 # 한 개 찾기 - 예시 user = db.users.find_one({'name':'bobby'}) # 여러개 찾기 - 예시 ( _id 값은 제외하고 출력) # {'_id':False} 생략했더니 json serializ..
몽고디비 세팅 2 - 파이썬 연결 부분 까지 통째로 변경 from pymongo import MongoClient client = MongoClient('mongodb+srv://yanoos:@cluster0.zlqekaz.mongodb.net/?retryWrites=true&w=majority') db = client.dbsparta #데이터 삽입 테스트 from pymongo import MongoClient #연결 client = MongoClient('mongodb+srv://yanoos:dudn0915@cluster0.zlqekaz.mongodb.net/?retryWrites=true&w=majority') #연결에 dbsparta라는 db db = client.dbsparta #임시 데이터 doc = { 'name':'bob'..
몽고디비 세팅 https://account.mongodb.com/account/register Cloud: MongoDB Cloud account.mongodb.com