Installing packages with the requirements.txt file to simplify our common tasks
Make sure you quit Flask's development server. You just need to press Ctrl + C in the Terminal or Command Prompt window in which it is running.
Now, we will install a number of additional packages. Make sure you have activated the virtual environment we created in the previous chapter and named Flask01
. After you activate the virtual environment, it is time to run numerous commands, which will be the same for either macOS, Linux, or Windows.
Now, we will edit the existing requirements.txt
file to specify the additional set of packages that our application requires to be installed in any supported platform. This way, it will be extremely easy to repeat the installation of the specified packages with their versions in any new virtual environment.
Use your favorite editor to edit the existing text file named requirements.txt
within the root folder for the virtual environment. Add the following lines after the last...