In this unit, we learn how to install py4web, and how to edit its files via Visual Studio Code, which allows for easy editing and debugging. You can also enable GitHub Copilot, which understands py4web pretty well, by enabling the Copilot extension in VSCode.
Note: The installation video briefly mentions two minor bugs; these have been fixed already in py4web.
On my linux system, I use the following files to configure VSCode for py4web development (replace /home/luca
with your home directory). The files are in the root py4web directory.
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: py4web",
"type": "python",
"request": "launch",
"program": "py4web.py",
"args": [
"run", "--errorlog=:stdout", "-L", "20",
"apps"
],
"console": "integratedTerminal",
"justMyCode": true
},
{
"name": "Python: File",
"type": "python",
"request": "launch",
"program": "${file}",
"justMyCode": true
}
]
}