开发者

Hide subdirectories from Media Root (Django)

开发者 https://www.devze.com 2023-02-27 23:04 出处:网络
I\'m serving static media content on the same server as my Django app. I\'m doing so through an apache2 config file which Alias-es my media directory.

I'm serving static media content on the same server as my Django app. I'm doing so through an apache2 config file which Alias-es my media directory.

It works in that the server serves the media directory as static content and the Django app through a WSGI.

The problem is that, when a user goes to my media url (www.mysite/media/) they can view all of my static content directories. I don't want that.

What can I do abo开发者_运维知识库ut this?

Thanks, Brendan


Either disable directory listings (Options) or add empty index.html files.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号