You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example of a production stack you can use to replace the Flask server is Gunicorn and Nginx.
A flow chart looks like this: Web request -> Nginx -> Gunicorn -> Flask
Here's a very simplified explanation to help you get the concepts down:
Think of Nginx as a security guard. It handles all of the traffic coming from the public internet and ensures that your application is not being swamped by too many spam requests.
Flask does not handle HTTP requests directly, it uses the WSGI standard to understand HTTP requests. Gunicorn acts as a translator, turning the HTTP requests into the WSGI format for Flask.
Finally, your Flask app:
receives the WSGI request from Gunicorn
manipulates it as specified in your Python code
and sends a response back up the chain: Flask -> Gunicorn -> Nginx -> internet.
I know this is a bit overwhelming! If you're anything like me you will find it very difficult at first, but just know that one day it will all click and you will feel like this :P
At the bottom of the readme, there are some commands to get started with development. How would that be different for a production environment?
The text was updated successfully, but these errors were encountered: