Notice
Recent Posts
Recent Comments
Link
250x250
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 |
Tags
- java
- 프로그래머스
- 스프링부트
- 프런트엔드
- 미니정리
- 알고리즘
- 코드 테스트
- jpa
- BACK-END
- 코드테스트
- 스프링
- MySQL
- 데이터베이스
- 프론트엔드
- 오라클
- 디자인 패턴
- 서버
- spring
- SQL
- 백엔드
- web
- node.js
- JavaScript
- oracle
- Next.js
- 자바
- 정리
- 자바스크립트
- jsp
- 쿼리
Archives
- Today
- Total
참치코더의 꿈 메모장
Python / 파이썬 flask 웹 서버 연결(feat. 노마드 코더) 본문
728x90

|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# py -m pip install flask // flask 라이브러리 다운로드 , 현재 파일은 main.py
from flask import Flask, render_template
app = Flask("JobScrapper")
@app.route("/") # / 요청 반환 함수 작성
def home():
return render_template("home.html") # 문자를 반환할 수도 있다.
@app.route("/search") # /search 요청 반환 함수 작성
def hello():
return render_template("search.html") # 각 templates 안에 html 파일을 입력해야 한다.
app.run("0.0.0.0")
# templates 같은 트리 레벨 상에 main.py가 있어야 하고 templates 안에는 render_template가 실행할 파일이 있어야 한다.
|
cs |
728x90
'파이썬' 카테고리의 다른 글
| 노마드 코더 / 파이썬 remoteok 스크래핑 하기 코드 작성 (0) | 2026.01.12 |
|---|---|
| Python / 클래스(Class) 정리 (1) | 2026.01.10 |
| Python / Dictionary 정리 (0) | 2026.01.07 |
| Python / 파이썬 리스트(List)와 튜플(Tuple) 정리 (0) | 2026.01.06 |
| Python / f-string 정리 (1) | 2026.01.04 |
Comments