import os
from django.http import HttpResponse
def get_image(request):
image_path = os.path.join(os.path.dirname(__file__), 'images/picture.png')
image_file = open(image_path, 'rb')
image_data = image_file.read()
return HttpResponse(image_data, mimetype='image/png')
Комментариев нет:
Отправить комментарий