Creating a Flask server
We will now create a new Flask web server, which will replace our Nameko Web Server. Flask is better suited to handling web requests than Nameko and comes with a lot more baked in while still being fairly lightweight. One of the features we will take advantage of is Sessions, which will allow our server to keep track of who's logged in. It also works with Jinja2 for templating, meaning that our existing template should already work.
Start by adding flask to our base.in file, then pip-compile and install (version 0.12.2 at the time of writing) using the same process as earlier.
Getting started with Flask is quite straightforward; we will start by creating our new home page endpoint. Within your temp_messenger directory, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access