什么是“目录索引不允许在这里”。意味着Django错误? [英] What does "Directory indexes are not allowed here." mean in a Django error?

查看:3085
本文介绍了什么是“目录索引不允许在这里”。意味着Django错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 找不到页面(404)
请求方法:GET
请求URL:http://78.198.124.245/
目录索引不允许在这里。
您正在看到此错误,因为您的Django设置文件中有DEBUG = True。将其更改为False,Django将显示标准的404页面。

什么是目录索引不允许在这里。意思?什么是目录索引?



我已经搜索到,结果我发现所有都与提供静态文件有关。但是,我不认为我这样做。这个错误是什么意思?

解决方案

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


I am trying to debug this bizarre 404 error that surfaced in my Django application.

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.

What does "Directory indexes are not allowed here." mean? What is a directory index?

I Googled around, and the results I found all have to do with serving static files. However, I don't think I do that. What does this error mean?

解决方案

Check your settings.py file for the STATIC_URL value. You want the value to be the subfolder where your static files are stored - generally STATIC_URL = '/static/'.

这篇关于什么是“目录索引不允许在这里”。意味着Django错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆