Forums

[Django] loading user uploaded media files

I seem to be having a problem when i try display files uploaded by the user.

When i follow the link in the generate html source it shows me the correct file, however it is not being rendered on the html page.

does anyone have any ideas as to why this is occurring?

have you got an example that we could look at?

yes sorry,

settings.py:

MEDIA_ROOT = '/home/JanoM/TextBookExchange/media' MEDIA_URL = '/media/'

in the "web" tab for my app the Url and directory are exactly those ^ aswell.

example of a template tag: <img src="/media/advert_img/University_of_Auckland/ACADENG/91F/8gKxx.jpg" />

which in the html source if i click links to: http://www.textbookexchange.co.nz/media/advert_img/University_of_Auckland/ACADENG/91F/8gKxx.jpg

which shows me the image, but it's not being rendered on my webpage

That all looks like it should be working. Particularly since you can request the image in the browser. A little spelunking led me to http://www.textbookexchange.co.nz/University_of_Auckland/ACADENG/91F which looks like it's related to the image you're talking about. That page has no <img> tag.