Skip to content

Workshop Part 2

ABG edited this page Nov 17, 2022 · 6 revisions

Workshop Part 2 Prerequisites:

Attendees should have completed Workshop Part 1 or successfully completed all items on our environment setup list:

  • Git installed
  • GitHub account and Two-Factor Authentication (2FA)
  • IDE or Code Editor (we prefer VS Code)
  • Docker and Docker-compose installed/downloaded from the internet
  • Basic knowledge of Python – see lessons here
Additional resources (read if you want to, but not required)
  • Basic knowledge of Git (link)
  • Docker (link)
  • Django Rest Framework (link)

Overview

This portion of the workshop will work through the steps for creating a PostgreSQL database table using Django, creating an API endpoint with the Django REST Framework (DRF), and writing tests using Pytest.

Agenda

  • Select an issue (5 minutes)
  • Create a model (5 minutes)
  • Write a test for the model and make sure it passes (10 minutes)
  • Register the model (5 minutes)
  • Make sure the admin site is working (5 minutes)
  • Create a serializer for the model (5 minutes)
  • Create a view set for the API endpoints (15 minutes)
  • Register the endpoint (5 minutes)
  • Create a test for the endpoint(s) (10 minutes)
  • Troubleshooting (10 minutes)
Clone this wiki locally