Facing a Cors error but that is already enabled in Django rest framework and react

I am facing one issue in my app which is developed in react and Django rest framework. In DRF api i am uploading the video and playing in react app. But video player slider not working then i have enabled the byte range request in my django rest app. But when i am enabling that setting then it giving a cors error in vtt Caption file. and also getting a cors error while downloading a pdf file from react app but when i am disabled the byte range request the video player slider not working but pdf downloading and video caption file working fine.

Here is the code of byte range request in django rest app.
Screenshot_2

Please share your suggestions thanks

i have enabled the byte range request in my django rest app. But when i am enabling that setting then it giving a cors error in vtt Caption file. and also getting a cors error while downloading a pdf file from react app but when i am disabled the byte range request the video player slider not working but pdf downloading and video caption file working fine.

If this - dj-static · PyPI - is the package you’re using here, it’s quite old, and even the authors are saying you shouldn’t be using it. (See GitHub - heroku-python/dj-static: DEPRECATED - use WhiteNoise instead!)

If that’s not the package you’re trying to use, please point us to the one you are using.

Yes i am using that package. Can you guys please suggest me what i need to use to fix video slider issue.
when i am using this setting then all things working fine but video slider not working
image

You have a number of different options:

  • Don’t use Django to handle static files, use your webserver for that. (nginx handles range requests quite well)

  • Try what their docs suggest (use WhiteNoise instead)

  • Find another package to do what you’re looking to do with it.

  • Fork that package and bring it up to date.

but when i am checking with WhiteNoise then its not supporting the media files.