I would like to create a GET endpoint that returns the JSONResponse
of the current logged-in user. Ideally, it would look like:
{
"username": "joe",
"email": "[email protected]",
"first_name": "",
"last_name": "",
"last_login": "2021-09-17T17:11:00.039Z",
"is_superuser": true,
"is_active": true
}
(Note that I'm using Django 3.2, not Django REST API)
This requires serializing the current user object, but serializing a single object is... opaque in the documentation, and many similar questions have responses from 6 or more years/two major versions ago.