Setting up WingIDE to debug Flask projects

  1. Open your Flask project in WingIDE.

  2. Navigate to the "Project" menu and select "Properties."

  3. In the "Project Properties" dialog, choose the "Debug" category.

  4. Under "Python Executable," select the Python interpreter associated with your Flask project.

  5. Set the "Working Directory" to the root directory of your Flask project.

  6. Click on the "Environment" category in the same dialog.

  7. Add the necessary environment variables required for your Flask application to run. This may include variables like FLASK_APP and FLASK_ENV.

  8. Save the changes to the project properties.

  9. Create a new debug configuration by selecting "Debug" from the "Run" menu and then choosing "Edit Current."

  10. In the "Debug Properties" dialog, set the "Main Debug File" to the entry point file of your Flask application.

  11. Under the "Environment" tab, make sure the required environment variables are set for debugging.

  12. Save the debug configuration.

  13. Place breakpoints in your code by clicking in the left margin of the editor next to the line numbers.

  14. Start the Flask application in debug mode by selecting "Debug" from the "Run" menu.

  15. WingIDE will launch the Flask development server in debug mode, and you can now interactively debug your Flask application.

  16. Use the debugging tools in WingIDE, such as the Debug Probe and Variable Explorer, to inspect and modify variables during runtime.

  17. To stop the debugging session, click the "Stop" button in the WingIDE toolbar.

  18. Review the debugging information in the WingIDE "Debug I/O" tool and the "Debug Console" for additional insights.

  19. Make necessary code changes based on debugging information and repeat the debugging process as needed.

  20. Once you've finished debugging, save your changes and close WingIDE.