Network security versus application security
In today's scenario, web application security depends upon two primary surfaces--the web application itself and the platform on which it is deployed. You can separate these two surfaces, as any web application cannot be deployed with a platform.
The web application stack
It is very important to understand the distinction between a platform and an application because of the impact it has on security. A typical web application would have an architecture similar to the one depicted in the following diagram:

Most web applications depend on web servers, such as Apache/HTTP server, Rails, nginx, and others, which actually handle the incoming request based on the type of application. These web servers keep track of the incoming traffic; they also validate the request and respond to it accordingly, considering all user authentication is validated. In our case, Flask acts as the web server for our application.