I upload the files to the server to specific folders, organized by projects. (I forgot to mention that I use Docker)
On DB I save:
id
4
path
/var/local/vvv/project-files/project_2/v_5//r_4_C5R1ud0W8AQwnxa.jpg:large.jpeg
filename
r_4_C5R1ud0W8AQwnxa.jpg:large.jpeg
file_type
jpeg
How can I get the absolute path ?
Something like this:
http://127.0.0.1:8000/media/r_4_C5R1ud0W8AQwnxa.jpg
The only thing I could do is:
http://127.0.0.1:8000/api/vv/download_resource/4
but it doesn't work for what i need.
Please HELP
My Model where are the images:
class Resource(utils.SafeDeleteModel):
path = models.CharField(max_length=200, null=True) # just to define where to save to
file_name = models.CharField(max_length=100, null=True)
file_type = models.CharField(max_length=100, null=True)
added_on = models.DateTimeField(auto_now_add=True)
added_by = models.ForeignKey(User, null=True, blank=True)
comment = models.TextField(null=True, blank=True)