If I save some images with my form they are saved in the media folder in the correct path how it should be. If i want to show the images they wont appear, it’s confusing because yesterday it worked with the same code (i guess it was the same code lol)
so this is my code from the template to show the image:
<img src="/DivusX/StartSite/media/{{ image }}"/>
this is my path:
and my database says
so it should work, in other files I also have difficulties with the media folder maybe something is wrong there
here are my settings
MEDIA_URL = 'DivusX/StartSite/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'StartSite/media/')
and this in the urls of my app
urlpatterns = urlpatterns+static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)
I also have a download button and if I hover it the path is shown (the button doesnt work because of the same thing as above) this is the shown path:
okay so I found the error, I had DEBUG=False and with my server nginx the files cant be served if debug is false and the files are in the normal path so I had to move them to my var/www and configure my sites-available with my new path and after reloading nginx the files were shown with debug false so everything works now. Thanks!