Python - Django 文档说这是一种不安全的提供静态文件的方式 - 这是真的吗?如果是,怎么会这样?
我遵循这种方式传递静态文件,但根据免责声明在顶部,它既不安全又低效。这是真的吗?我应该怎么做呢?
另外,还有一个半题外话的问题:术语“媒体”和“静态文件”在网络编程的上下文中可以互换吗?我看到它们经常被扔来扔去,而且它们似乎指的是同一件事。
I follow this way of delivering static files but according to the disclaimer at the top, it's both insecure and inefficient. Is it true? How should I be doing it instead?
Also, a semi-off-topic question: Are the terms 'media' and 'static files' interchangeable in the context of web programming? I see them thrown around a lot and they seem to be referring to the same thing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然。你认为他们为什么这么说?
这就是阿帕奇的用途。或者 Ngingx 或 lighttpd 或任何大量其他 Web 服务器。
通常。
Django 1.3 确实区分了“媒体”和静态文件,“媒体”是上传和下载的内容,静态文件是静态的。
Of course. Why do you think they say it?
That's what Apache is for. Or Ngingx or lighttpd or any of a large number of other web servers.
Usually.
Django 1.3 does make a distinction between "media" as stuff that gets uploaded and downloaded and static files which are -- well -- static.
同意 S.Lott 的回答,但是当您质疑这是一种不安全的提供静态文件的方式,是真的吗?
我想有必要解释一下原因。
为什么从 django 提供静态文件不安全的答案解释了原因。此处引用:
Agree with S.Lott's Answer, but when you questioned It's an insecure way of serving static files, is it true?
I guess it's necessary to explain why.
The answer of Why serve static files from django is insecure explained the reason. Quoted here: