Flask for Static Content

We'll look at slight modifications in existing modules to specify the location of the static files to be served.

While not necessarily recommended for heavily used applications, it is possible to forgo the web server for serving static content and just use the application server to serve the static content along with the dynamic content. The main thing we would lose in this case is scalability and perhaps a bit of performance.

About the application

In this application, we’ll look at some modifications in our appserver.py module to specify the location of the static files to be served in our application. We will also look at a slight modification regarding the change in default route from / to /api. Lastly, we will look at how we can bind our server on a 8080 port using Gunicorn.

This is what the application looks like:

Note: To log in, use the username admin and password 123.

Get hands-on with 1200+ tech skills courses.