April 2018
Beginner
340 pages
7h 54m
English
The first step is to install flask. As usual, we can install flask using pip inside a virtual environment.
Using the command line, navigate to the folder where you have been writing your chat application and enter the following commands:
python3 -m venv envsource env/bin/activatepip install flask
Pip should take care of installing flask, along with its dependencies, inside your new virtual environment.
Once this has finished, create a folder named server alongside your Python files for the previous chapter. This is where we will be placing our web service for the chat application.
Inside this folder, create a file named server.py and place the following code inside:
from flask import Flaskapp = Flask(__name__)app.config.from_object(__name__) ...