python basic flask web
Set up a virtual environment: Create a new directory for the project and navigate to it using the terminal. Then, install virtualenv using pip.
Activate the virtual environment: Once virtualenv is installed, activate it using the appropriate command for your operating system.
Install Flask: Use pip to install Flask within the activated virtual environment.
Create a Flask application: In the project directory, create a new file, such as app.py, and write a basic Flask application with a route and a function to return a simple string.
Run the Flask application: In the terminal, set the FLASK_APP environment variable to the name of the application file (e.g., app.py) and then use the flask run command to start the development server.
Access the application: Open a web browser and navigate to the specified address (e.g., http://127.0.0.1:5000/) to see the output of the Flask application.
Deactivate the virtual environment: Once you are done working on the project, deactivate the virtual environment using the appropriate command for your operating system.
This sequence of steps allows you to set up a basic Flask web application using Python.