Flask installation

Setup folder

Create 2 folders in ‘Documents’

  1. python3
  2. myproject

Install Python

  1. Download from https://www.python.org
  2. Check ‘Add to path…’
  3. Click Custom installation
  4. Install the python runtime -> ‘python3’ folder
  5. C:\Users\batlabadmin1\Documents\python3

VS Code

  1. Open VS Code
  2. Open ‘myproject’ folder
  3. Drag the ‘myproject’ to VS Code

Windows version

Only run these one time in termainl

  1. Open terminal
  2. 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