Workshop Solutions - No merge needed #1
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to the Django-based application, primarily aimed at enhancing its functionality and usability. The changes include setting up a development container, updating the README, introducing new API routes and their corresponding tests, creating a new HTML home page, and adding sample data for Azure VMs.
API Endpoint Enhancements:
copilot/api/views.py
: Added two new API endpoints:get_hello
andget_vms
. Theget_hello
endpoint returns a greeting message based on a query parameter, while theget_vms
endpoint returns a list of VMs read from a local JSON file.copilot/api/urls.py
: Updated the URL configuration to include the newget_hello
andget_vms
endpoints.Testing:
copilot/api/tests.py
: Introduced several tests for the newget_hello
andget_vms
endpoints. The tests validate the endpoints' responses and their content.Project Documentation:
README.md
: Updated the project's README file to provide an overview of the project and instructions on how to get started. It also includes a brief description of the labs available in the project.docs/001-implement-new-route.md
,docs/002-data-and-services.md
,docs/003-create-homepage.md
: Added detailed lab instructions in these new markdown files. The labs guide users through the process of adding new API routes, generating sample data, testing APIs, and creating a homepage. [1] [2] [3]Development Environment:
.devcontainer/devcontainer.json
: Integrated GitHub Copilot into the development environment by adding it as an extension in the VS Code devcontainer configuration.Homepage Creation:
copilot/copilot/views.py
: Added a newhome
view function to render the homepage.copilot/copilot/urls.py
: Included the newhome
view in the URL configuration.copilot/copilot/templates/home.html
: Created a new HTML template for the homepage. The page displays a list of VMs fetched from the/api/vms/
endpoint.Other Changes:
copilot/copilot/settings.py
: Modified the settings to include the project's templates directory in the Django templates' DIRS setting.copilot/data/vms.json
: Added a new JSON file containing sample data for VMs. This data is used by theget_vms
API endpoint.copilot/requirements.txt
: Added new Python packages required for the project.