Flask installation
Setup folder
Create 2 folders in ‘Documents’
- python3
- myproject
Install Python
- Download from https://www.python.org
- Check ‘Add to path…’
- Click Custom installation
- Install the python runtime -> ‘python3’ folder
- C:\Users\batlabadmin1\Documents\python3
VS Code
- Open VS Code
- Open ‘myproject’ folder
- Drag the ‘myproject’ to VS Code
Windows version
Only run these one time in termainl
- Open terminal
- Then run the following commands (copy and paste in terminal):
py -m venv venv
Set-ExecutionPolicy Unrestricted -Scope Process
.\venv\Scripts\activate
Now you will see “(venv)>” in the front. For example: “(venv) PS C:\Users\batlabadmin1\myproject>”
Then run the following commands (copy and paste in terminal):
py -m pip install flask
pip install -U Flask-SQLAlchemy
Start Flask server
Start Flask server, then run these in (venv) terminal:
flask run --debug
Quit terminal
If you quit the “(venv)”, then run these again.
Set-ExecutionPolicy Unrestricted -Scope Process
.\venv\Scripts\activate
flask run --debug