khwilo / django-dev-labs

Experimentation on Django features
MIT License
0 stars 0 forks source link

chore: Install DRF #44

Closed khwilo closed 3 months ago

khwilo commented 3 months ago

Description

Install and configure the Django Rest Framework (DRF) to enable working with REST APIs

TODO

Implementation

  1. Migrate the initial database schema
  2. Create a superuser
  3. Define a user serializer and expose fields to view on the API endpoint
  4. Define a user view set to define the behavior of the API endpoint
  5. Define a router for specifying the URL pattern
  6. Add the routes defined in the router to the URLs and specify a basename /api/v1

Testing

The API root page (http://127.0.0.1:8000/api/v1/) works:

Screenshot 2024-06-30 at 15 47 30

One can view the default user, which is the super user:

Screenshot 2024-06-30 at 15 47 55