Skip to content

Instantly share code, notes, and snippets.

@lordsarcastic
Last active March 29, 2023 04:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lordsarcastic/d627c06a83df870c1c17fb5b8fd73cd6 to your computer and use it in GitHub Desktop.
Save lordsarcastic/d627c06a83df870c1c17fb5b8fd73cd6 to your computer and use it in GitHub Desktop.
Return more information for user on signup in Django Djoser
from djoser import serializers as djoser_serializers
class UserCreateSerializer(djoser_serializers.UserCreateSerializer):
class Meta(djoser_serializers.UserCreateSerializer.Meta):
"""
Serializer handling user creation from Djoser. We customize
because we want the names to be consistent
"""
fields = ("username", "email", "is_verified", "uuid", "password")
# Djoser settings
DJOSER = {
# rest of config
"SERIALIZERS": {
"user_create": "users.serializers.UserCreateSerializer"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment