on
WSGI — Web Server Gateway Interface
WSGI — Web Server Gateway Interface
WSGI — Web Server Gateway Interface.
The main goal of WSGI is to facilitate easy interconnection of servers and web frameworks/applications. WSGI defines a standerd API for web servers(ex: uWSGI, Twisted, Gunicorn) to connect and talk to web frameworks like Django, flask, pyramid.
WSGI는 서버와 웹 프레임워크를 연결하기 위해서 사용한다. WSGI는 웹서버를 위한 API(uWSGI, Guicorn)등으로 장고, 플라스트 등의 웹 프레임워크와 연결된다.
앱을 개발용 서버로 띄웠을 때 나오던 warning문구. production에서는 WSGI 서버를 사용하라고 나옴.
It standardises the language and protocols between our Python Flask application and the host server. Again, but in English: Normal web servers can't run Python applications, so a special type of server was created (WSGI) to run python applications. So Heroku will call gunicorn to run our code and gunicorn will know how to speak to Heroku.
파이썬 프레임워크 앱과 호스트 서버 사이에 언어와 프로토콜을 표준화해준다. 일반적인 웹 서버는 파이썬 앱을 작동할 수 없기 때문에 특별한 종류의 서버인 WSGI를 사용하는 것이다. Heroku가 gunicorn(WSGI)을 불러서 코드를 실행시키고, gunicorn은 Heroku와 소통할 수 있다.
Next, we need to tell Heroku about our gunicorn server and how to run our Flask app, we do that using a Procfile.
Heroku에게 gunicorn서버와 앱을 어떻게 작동하는지 알려주려면 Procfile을 이용한다.
Type the following into the Procfile:
web: gunicorn main:app
This will tell Heroku to create a web worker, one that is able to receive HTTP requests.
이 라인은 Heroku에게 HTTP 요청을 받을 수 있는 web worker를 만들도록 한다.
From: udemy course by angela yu
from http://dayleeand.tistory.com/62 by ccl(A) rewrite - 2021-07-13 23:26:28