I have a news section on my app, where the user can upload a photo for the new. The problem is that the photo only display when DEBUG is set to false. I configured the web tab like this:
URL: /media/
Directory: /home/mgv/myapp/media/news
settings.py
STATIC_URL = "/static/"
STATICFILES_DIRS = [str(BASE_DIR.joinpath("static"))]
STATIC_ROOT = str(BASE_DIR.joinpath("staticfiles"))
MEDIA_URL = "/media/"
MEDIA_ROOT = str(BASE_DIR.joinpath("media"))
model.py
image = models.ImageField(verbose_name=_("Image"), null=False, blank=False, upload_to="news")
When inspecting the site the src atrribute point to the rigth direction and the file is in the folder.
Any help would be appreciated.