Hello, I am trying to pass the ID of a Model in an Image Field URL(upload_to) and then access it Through a URL unique to The instance.
Here's What I did (Amature);
class User(models.Model): serial = models.AutoField(primary_key=True) profile = models.ImageField(upload_to=f"profiles/{serial}/")
But all I'm Getting is OSError.
I wanted to save the file to profiles/{serial}/
directory in the app.
So Every Instance of the Model has its own Directory. And Then access it Through host:port/api/users/{serial}/profile.jpg
My View Set is served through host:port/api/users
Is there a way I can Do it? Any Help is Highly Appreciated. A Detailed Explaination is Even more Appreciated.