This guide explains how to set up the development environment for the project.
All installation commands must be executed after activating the virtual environment. Otherwise, packages will be installed globally on the system.
python3 -m venv .venvsource .venv/bin/activate.\.venv\Scripts\Activate.ps1.venv\Scripts\activate.batAfter activation, the terminal will display the prefix (.venv) at the beginning of the line, indicating that the virtual environment is active.
If PowerShell blocks script execution, run the following command once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserTo deactivate the virtual environment:
deactivateAfter this command, the (.venv) prefix will disappear, indicating that you have returned to the system Python environment.
With the virtual environment active, upgrade pip:
pip install --upgrade pippip install -r requirements.txtpip install -r requirements_dev.txtTo check that the packages were installed correctly:
pip listOpen the project folder in Visual Studio Code.
Select the Python interpreter:
Ctrl + Shift + P Python: Select Interpreter
Then select:
.venv/bin/python
Make sure the virtual environment is activated before running the app.
flask --app src.app run
or
export FLASK_APP=src.app
export FLASK_ENV=development
flask run
set FLASK_APP=app.py
set FLASK_ENV=development
flask run
$env:FLASK_APP = "app.py"
$env:FLASK_ENV = "development"
flask run
Run the following commands from the project root directory and inside your virtual environment (venv).
flask --app src.app db init
flask --app src.app db migrate -m "initial migration"
flask --app src.app db upgrade
- Python
- Pylance
- Python Debugger
- Python Environments
- SQLite Viewer