Skip to content

Instantly share code, notes, and snippets.

@Joel-hanson
Created July 31, 2020 10:33
Show Gist options
  • Save Joel-hanson/0f4d2c051d1fcd3a2d7a540806132074 to your computer and use it in GitHub Desktop.
Save Joel-hanson/0f4d2c051d1fcd3a2d7a540806132074 to your computer and use it in GitHub Desktop.
serializer for file upload in django rest framework
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