Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions.
Deploying your cloud server
If you have not already registered with Cloudwafer, you should begin by getting signed up. Take a moment to create an account after which you can quickly deploy your cloud servers.
Once you have signed up, log into your Cloudwafer Client Area and deploy your Cloudwafer cloud server.
Updating System Packages
It is recommended that you update the system to the latest packages before beginning any major installations. Issue the command below:
sudo apt-get update && sudo apt-get upgrade
Step 1: Python 3 and venv
First, verify that Python 3 is installed on your system by issuing the command below:
Next, install the
python3-venv package that provides the
venv module using the following command:
sudo apt install python3-venv
If you don't have Python3 installed, check our guide on installing Python3 on Debian.
Step 2: Create a Virtual Environment
Create a directory where we would store our Python 3 virtual environments. Note that the user must have read and write permissions to the directory.
Next, create a new directory for our Flask application and navigate into it:
mkdir cloudwaferlabs_flask_app cd cloudwaferlabs_flask_app
Next, issue the command below to create our new virtual environment:
python3 -m venv venv
venv contains a copy of the Python binary, the Pip package manager, the standard Python library and other supporting files. Next, activate it by running the activate script:
Next, issue the command below to install Flask:
pip install flask