I am exploring file/images uploads in Django. I have a model with Photo class which has thumb ImageField. I uploaded thumb with admin panel and I made template which just gives <img src='{{photo.thumb.url}}' />. Unfortunately I don’t get any images and when I try to get direct link it says ‘page not found’. It seems that django either does not move them to media_url or maybe it has no permission to access it? I wonder what can I do to fix it.
Thanks a lot beforehand.
PS: Running django on dev server with sqlite db.
The development server by default doesn’t serve static files (see the documentation). You’ll need to add the following code to the bottom of your
urls.pyto enable static file serving:That should sort you out.