'How to extend 'users/me/' fields in djoser

Is it possible to extend the user field in djoser? I'm using djoser jwt token authentication in Django restframework. And as it it is, the functionality of djoser comes from djoser.url and djoser.urls.jwt. Only username, email and password are the parameters I want users to provide during registration. After registration, they can provide other details. When using JWT plainly without djoser, I would create a model for profile and provide the fields that register individuals should complete after registration. But with djoser, user's details can be obtained from /users/me/ endpoints. This is the first time I'm using djoser package, and it seems to me that /users/me/ functions as the endpoint for user's profile already as it's explained in their documentation https://djoser.readthedocs.io/en/latest/base_endpoints.html#user-resend-activation-e-mail

I still want to collect information from users such as their data of birth, country, marital status and others. But I want to provide them with profile page which has fields where thay can provide those details. My question now is, is it possible to use djoser users/me/ endpoint to accomplish that? If yes, how? It's not very clear how to accomplish that in the documentation.



Solution 1:[1]

Had the same issue. They may have updated docs since the question but you can use 'current_user' to set users/me to custom serializer.

https://djoser.readthedocs.io/en/latest/settings.html?highlight=users%2Fme#serializers

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Spirconi