How does Django serve media files?

前端 未结 5 490
谎友^
谎友^ 2021-01-02 05:01

I have set up a Django application that uses images. I think I have set up the media settings MEDIA_ROOT and MEDIA_URL correctly. However the images don\'t show up. Do you k

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 05:32

    Serving static content from Django is discouraged from the developer themselves (if I'm not wrong, it only works when in debug mode). You should use a dedicated web server, instead.

    If you really need to do that, anyway, read the documentation on how to serve static files.

提交回复
热议问题