Answers for "media file in response to http"

0

media file in response to http

from django.http import FileResponse

def send_file(response):

    img = open('media/hello.jpg', 'rb')

    response = FileResponse(img)

    return response
Posted by: Guest on October-25-2021

Browse Popular Code Answers by Language