What is flask? How to install it in ubuntu linux.
Flask is a free and open-source micro web framework for Python designed to help developers build secure, scalable and maintainable web applications.It doesn’t require any pre requisites tools/lib.Third party libs can be added.
To check your ubuntu version type command :
- python3 — version
The recommended way to create a virtual environment is to use the venv
module. To install the python3-venv
package that provides the venv
module run the following command:
sudo apt install python3-venv
Start by navigating to the directory where you would like to store your Python 3 virtual environments. It can be your home directory or any other directory where your user has read and write permissions.
Create a new directory for your Flask application and navigate into it:
mkdir my_flask_appcd my_flask_app
cd my_flask_app
To create your new virtual environment
python3 -m venv venv
The command above creates a directory called venv
, which contains a copy of the Python binary, the Pip package manager , the standard Python library and other supporting files. You can use any name you want for the virtual environment.
To start using this virtual environment, you need to activate it by running the activate
script
- source venv/bin/activate
Installing Flask
Python package manager pip to install Flask:
pip install Flask