I have some model with a FileField() looks like this:
image = models.FileField(upload_to='/Users/john/projects/MyDjangoApp/foobars/images/')
So foobar is some module from MyDjangoApp. In future there comes another module like barfoos and this will have an own images folder.
What I don't understand is how to handle this in the template. Now there stand something like:
<td><img src="{{ foobar.image.url }}" height="350" width="350"></td>
So there stand the following:
/Users/john/projects/MyDjangoApp/foobars/images/71RkbKwBxnL._SL1004_.jpg
But it must be, something like:
http://127.0.0.1:8000/foobars/images/71RkbKwBxnL._SL1004_.jpg
All url patterns I find only handle this if the images hosted in /MyDjangoApp/static/images, I wish to handle the files in /MyDjangoApp/foobars/images and later /MyDjangoApp/barfoos/images.
Ho to handle this in Django.
Thanks a lot for your time!