Created
July 31, 2020 10:33
-
-
Save Joel-hanson/0f4d2c051d1fcd3a2d7a540806132074 to your computer and use it in GitHub Desktop.
serializer for file upload in django rest framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.serializers import Serializer, FileField | |
# Serializers define the API representation. | |
class UploadSerializer(Serializer): | |
file_uploaded = FileField() | |
class Meta: | |
fields = ['file_uploaded'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment