[Fixed]-Django Media url returns 404 NOT FOUND

14👍

Please don’t make any url with hard coded. This is more than bad practice.

BASE_URL = 'http://127.0.0.1:8000'

You can’t write like that.

Your solution,

settings.py

MEDIA_URL = '/media/'

urls.py

urlpatterns = [
.......
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Hope this works.

Leave a comment