flask.palletsprojects.com/en/1.1.x/quickstart/#a-minimal-application
Quickstart — Flask Documentation (1.1.x)
For web applications it’s crucial to react to the data a client sends to the server. In Flask this information is provided by the global request object. If you have some experience with Python you might be wondering how that object can be global and how
flask.palletsprojects.com
위 링크의 기본 flask 명령을 아래와 같이 입력하였다.
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
그리고 visual studio에서 CTRL + F5 로 실행을 시켰지만 아래 그림처럼 아무런 메세지없이 진행되었다.
해결 방법 >>
위 그림처럼 Run Without Debugging 을 실행시키지 말고 F5 또는 Start Debugging을 실행한다.
그러면 아래와 같은 선택화면이 나오는데 Python File로 하는 것이 아니라 Flask로 실행하면 된다.
아래 그림처럼 정상적인 메세지를 받을 수 있다.
'파이썬(Python) > Flask' 카테고리의 다른 글
파이썬 flask에서 render_template 함수 예제로 이해해보기 (0) | 2021.05.04 |
---|---|
REST API란? flask를 통해 예제 실습하기 (0) | 2021.04.29 |
파이썬 Flask 기능 정리 - render_template, jinja2 (0) | 2021.01.29 |
파이썬 Flask 기능 정리 - url_for, HTTP 요청(GET,POST,PUT,DELETE,OPTIONS)과 처리방법 (0) | 2021.01.28 |
파이썬 Flask 기능 정리 - route, 변수(variable)<괄호>로 보내기, url 표기 방법 (0) | 2021.01.27 |