Sorry in advance if my question looks obscure. This is the error thrown by Django when I'm trying to serve multiple Django media(videos) URLs in my React homepage.This is the stacktrace:
Exception happened during processing of request from ('127.0.0.1', 5511)
File "D:\Django\myproject\app\env\lib\site-packages\django\core\servers\basehttp.py", line 174, in handle
self.handle_one_request()
Traceback (most recent call last):
File "C:\Users\Anshul\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "D:\Django\myproject\app\env\lib\site-packages\django\core\servers\basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "C:\Users\Anshul\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "C:\Users\Anshul\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
----------------------------------------
File "C:\Users\Anshul\AppData\Local\Programs\Python\Python38\lib\socketserver.py", line 720, in __init__
self.handle()
File "D:\Django\myproject\app\env\lib\site-packages\django\core\servers\basehttp.py", line 174, in handle
self.handle_one_request()
File "D:\Django\myproject\app\env\lib\site-packages\django\core\servers\basehttp.py", line 182, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "C:\Users\Anshul\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
This is the React snippet:
<video
preload="metadata"
id={this.props.id}
muted
ref={this.videoRef}
onClick={this.play.bind(this,1,this.props.id)}
onTimeUpdate={this.updateTime.bind(this,this.props.id)}
onCanPlay={this.getReady.bind(this,this.props.id)}>
<source src={this.props.source} type="video/mp4"/>
</video>
where video source refers to django media url provided by drf serializer.E.g
this.props.source = 'http://localhost:8000/media/buck_bunny.mp4'
The homepage contains multiple videos.The media URLs are fetched through API calls.Its a content feed page.Subsequent API calls to fetch media URLs are made when the user scrolls down the homepage for a certain amount. This is where the problem arises. If the user scrolls down very fast then API calls also get executed quickly leading to this error.