16 lines
359 B
Python
16 lines
359 B
Python
|
from django.contrib.auth.models import User
|
||
|
from rest_framework import serializers
|
||
|
|
||
|
class UserSerializer(serializers.ModelSerializer):
|
||
|
"""
|
||
|
Serialize a User object into JSON.
|
||
|
"""
|
||
|
class Meta:
|
||
|
model = User
|
||
|
exclude = (
|
||
|
'username',
|
||
|
'password',
|
||
|
'groups',
|
||
|
'user_permissions',
|
||
|
)
|