Skip to content Skip to sidebar Skip to footer

404 On Media Files - Django

Last night I uploaded my project to pythonanywhere.com where I wanted to test my production settings. In one of my models I allow users to upload JPG's (Logo of a team). The upload

Solution 1:

You need to set a media files mapping in PythonAnywhere's dashboard. From their documentation:

  • Go to the Web tab on the PythonAnywhere dashboard
  • Go to the Static Files section
  • Enter the same URL as MEDIA_URL in the url section (in your case, /media/)
  • Enter the path from MEDIA_ROOT into the path section (the full path, including /home/username/etc)

Then hit Reload and your uploaded files should be served correctly.

Post a Comment for "404 On Media Files - Django"