gpt4 book ai didi

django - Django 错误中的 "Directory indexes are not allowed here."是什么意思?

转载 作者:行者123 更新时间:2023-12-04 03:39:37 49 4
gpt4 key购买 nike

我正在尝试调试出现在我的 Django 应用程序中的这个奇怪的 404 错误。

Page not found (404)
Request Method: GET
Request URL: http://78.198.124.245/
Directory indexes are not allowed here.
You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

“此处不允许使用目录索引”是什么意思。意思?什么是目录索引?

我在谷歌上搜索,我发现的结果都与提供静态文件有关。但是,我不认为我会那样做。这个错误是什么意思?

最佳答案

检查 settings.py 文件中的 STATIC_URL 值。您希望该值是存储静态文件的子文件夹 - 通常是 STATIC_URL = '/static/' .

关于django - Django 错误中的 "Directory indexes are not allowed here."是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10644649/

49 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com