I have this problem where my images are only shown when logged in pythonanywhere. Static images work fine (css, js, png ..). But user uploaded images lack the permission to be shown to anonymous website users.
Here are my specs:
Django 1.8 with virtualenv
settings:
DEBUG = True;
ALLOWED_HOSTS = [],
MEDIA_ROOT ="/home/username/projectname/media",
MEDIA_URL = "/media/"
model:
img = models.ImageField(upload_to="")
template:
in a img tag I have:
src="https://www.pythonanywhere.com/user/username/files/home/username/projectname{{ context_variable_name.img.url }}"
webtab:
/media/
/home/username/projectname/media
Everyting I tried didn't work. I could use aws s3. But I would prefer pythonsanywhere storage system.
Thank you very much, for anykind of advice.