LANGUAGE VERSIONS python version - python3 3.9.2 python interpreter version - python3 3.9.2 64-bit('venv') / python3 3.9.2 64-bit('env')
INSTALLATIONS #FLASK Flask supports Python 3.5 and newer, Python 2.7, and PyPy. install Flask $ pip install Flask
Solve Cross Origin Resource Sharing with Flask pip install -U flask-cors
Connect with MySQL pip install pymysql
- INSTRUCTIONS FOR CREATE FLASK PROJECT
-
Create a new project folder on your file system
-
Open that project in command prompt to create a virtual environment named "env"
-
Enter below commands based on your interpreter # Linux sudo apt-get install python3-venv # If needed python3 -m venv env
# macOS python3 -m venv env # Windows python -m venv env
-
Open the project folder in VS Code
-
In VS Code, open the Command Palette and select the "Python: Select Interpreter"
-
The command presents a list of available interpreters, then you can select Python Interpreter
-
Update pip in the virtual environment python -m pip install --upgrade pip
-
Install Flask in the virtual environment python -m pip install flask
-
Inside the project create new python file and add code to import Flask and create an instance of the Flask object. from flask import Flask app = Flask(name)
-
Add functions with app.route
-
Save file and run the app python -m flask run
-