Flask Template
This sample repo contains the recommended structure for a Python Flask project. In this sample, we use flask to build a web application and the pytest to run tests.
For a more in-depth tutorial, see our Flask tutorial.
The code in this repo aims to follow Python style guidelines as outlined in PEP 8.
Running the Sample
To successfully run this example, we recommend the following VS Code extensions:
- Python
- Python Debugger
Open the template folder in VS Code (File > Open Folder...)
Create a Python virtual environment using the Python: Create Environment command found in the Command Palette (View > Command Palette). Ensure you install dependencies found in the
pyproject.tomlfileEnsure your newly created environment is selected using the Python: Select Interpreter command found in the Command Palette
Run the app using the Run and Debug view or by pressing
F5To test your app, ensure you have the dependencies from
dev-requirements.txtinstalled in your environmentNavigate to the Test Panel to configure your Python test or by triggering the Python: Configure Tests command from the Command Palette
Run tests in the Test Panel or by clicking the Play Button next to the individual tests in the
test_app.pyfile
Log in or sign up for Devpost to join the conversation.