Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当我访问www.mywebsite.com/static/时,我可以查看所有django静态文件的目录/索引。这安全吗?我怎样才能阻止它?_Django_Static - Fatal编程技术网

当我访问www.mywebsite.com/static/时,我可以查看所有django静态文件的目录/索引。这安全吗?我怎样才能阻止它?

当我访问www.mywebsite.com/static/时,我可以查看所有django静态文件的目录/索引。这安全吗?我怎样才能阻止它?,django,static,Django,Static,正如问题所说,我的django静态文件可以在website.com/static上看到 我怎样才能像其他django网站一样对公众隐藏它,我应该担心吗 谢谢 编辑: 相关:你能从你的设置中发布你的相关静态(根、URL、DIRS)变量吗?一定要在编辑中包含它 STATIC_ROOT = "/var/www/vhosts/abcd/static" # '' is the default # URL prefix for static files. # Example: "http://examp

正如问题所说,我的django静态文件可以在website.com/static上看到 我怎样才能像其他django网站一样对公众隐藏它,我应该担心吗

谢谢

编辑:


相关:你能从你的设置中发布你的相关静态(根、URL、DIRS)变量吗?一定要在编辑中包含它
STATIC_ROOT = "/var/www/vhosts/abcd/static"  # '' is the default

# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
STATIC_IN_VIEW_URL = 'http://mywebsite.com/static/'