Io attualmente ho una boccetta di applicazione in cui la struttura dei file simile a questo:
C:\Users\kmelton\Python\Flask\BGSCS-API-dev\InterjectApi\server.py
E la cartella attualmente ho aperto uno spazio di lavoro in VS Codice è il BGSCS-API-dev cartella.
Il mio lancio.json attualmente simile a questo:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "server.py",
"FLASK_ENV": "development"
},
"args": [
"run",
"--no-debugger"
],
"jinja": true
}
]
}
E su ogni tentativo di debug, ho un errore.
* Serving Flask app 'server.py' (lazy loading)
* Environment: development
* Debug mode: on
Usage: python -m flask run [OPTIONS]
Try 'python -m flask run --help' for help.
Error: Could not import 'server'.
So che probabilmente c'è qualcosa che devo aggiungere al mio lancio.file json, il percorso per il file correttamente, ma le cose che ho provato non ha funzionato per me. Grazie