I need help in finding the equivalent of streamingresponse in Django Ninja, can someone please help? #787
Unanswered
magedhelmy1
asked this question in
Q&A
Replies: 1 comment
-
Hi @magedhelmy1 it's all handled by django (you can just return django http response objects from ninja) - see docs here there is even little helper FileResponse for your case: from django.http import FileResponse
@api.get('/file')
def stream_file(request):
return FileResponse(open("myfile.png", "rb")) # this will do streaming automatically |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to find the evuivlanet of streaming responsings in Django Ninja,
Can someone assist me in that? Many thanks
Beta Was this translation helpful? Give feedback.
All reactions