I have an image problem that displays locally but not on shared hosting.
The site works well in hosting , the custom js and css files are ok.
In my Django template, I have this image:
<div class="col-sm-3 order-3 order-sm-3">
<!-- form pub -->
<img class="img-thumbnail" src="{% static 'img/exemple_banner_01.png' %}" alt="..." /> </div>
This image is in: static/img/myimage.png
I do python manage.py collectstatic
After that, this image is found here:
collectstatic/img/myimage_01.ze25a48a4c2.png
In settings file:
STATIC_URL = 'static/'
STATICFILES_DIRS = [str(BASE_DIR.joinpath('static'))]
STATIC_ROOT = str(BASE_DIR.joinpath('staticfiles'))
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage
My css and javascript files are ok.
When displaying, my image doesn’t show up.
mysite.com/static/img/myimage_01.ze25a48a4c2.png
“Not Found The requested URL was not found on this server.”
I tried to put in the settings: /home/user/public_html/myapp/static but it gives me a 500 error. I should add that I’m in debug False mode.
Thank for help
1