I have a load of models that have TextFields which (sometimes) contain links to images which the users have uploaded when they edited those fields.
So a field might contain something like this:-
This is my image
<img src="/media/uploads/myimage.jpg">
This works fine at the moment, as all of my media is being served from a directory on my web server by nginx.
However, I want to move all my user-uploaded media to Amazon S3 and not serve media from my server.
I've got everything working for the models that have images in ImageFields, as they just work out the path for the image using the django-storages API. But the images that are stored as above inside TextFields won't work any more, as they are relative paths, not S3 paths.
Is there a way to make this work without having to edit all the contents of all of the TextFields to change the img path to be the full S3 path? Not only does that seem like a very laborious process (even if I can do it programmatically) but what if I subsequently want to change to another storage service? I'll have to do it again!
It would be better if an image tag with a relative URL like that just knew that it had to find the real path using the full S3 URL but I'm not sure how to do that.