I'm writing a REST API. Users should be able to upload an image and view it. That part is easy, the images get saved to the media root, and serving them is handled separately by NGINX on /media/
.
The problem is that the user needs to be able to generate a temporary link to their image. It can't be a simple redirect, because what's the point of a temporary link if the end user gets redirected to a permanent link?
Is there a way in Django to redirect the request on the backend, fetch the image, and return it to the user on the same URL? If not, what's the proper way to do it?
I've looked through Google for some 30 minutes, and couldn't find anything. I'm sorry if it's obvious and my search queries were just wrong.