Media Files Not Showing On Debug False
I've just deployed a site with pythonanywhere, when I set to DEBUG mode to False, my media images dissapear, the path of my media folder is not found. I was asking myself what caus
Solution 1:
Found it, with pythonanywhere I had to setup media on the static files handler like this :
path :/media/
directory :/home/<myusername>/<myproject>/media
Then reload the domain name after setting DEBUG
to False
.
Solution 2:
The behaviour you are seeing is by design, Django doesn't serve static files in production mode. Serving many, potentially huge static files using Python will put a lot of stress on the server, while any of the common servers will handle that with ease.
Hence you need to serve them using Apache or nginx yourself: https://docs.djangoproject.com/en/1.10/howto/static-files/deployment/
Post a Comment for "Media Files Not Showing On Debug False"