How to access uploaded files in Django?

2019-09-09 21:50发布

I followed the uploading example for django here:

Minimal Django File Upload Example

Now I want display the uploaded file (.jpg or .pdf) in the browser. By clicking on the link the browser opens the URL: localhost:8000/media/documents/2014/08/04/test1.jpg and Django throws an error: The current URL, media/documents/2014/08/04/test1.jpg, didn't match any of my defined urls.

How can I change the url-settings for my media files?

Thanks!

1条回答
登录 后发表回答