我尝试使用render来显示在PyCharm上编辑的HTML,但是当我输入地址:时127.0.0.1:8000/index/,TemplateDoesNotExist出现以下异常:
TemplateDoesNotExist at/index/index.html请求方法:GET请求URL:http://127.0.0.1 :8000/index/ Django版本:1.11.1异常类型:TemplateDoesNotExist异常值:index.html异常位置:D:\ python3 get_template中的.6.1\lib\site-packages\django\template\loader.py,第25行Python可执行文件:D:\ python3.6.1\python.exe Python版本:3.6.1 Python路径:
['C:\ Users\Administrator\guest','D:\ python3.6.1\python36.zip','D:\ python3.6.1\DLLs','D:\ python3.6.1\lib','D:\ python3.6.1',' D:\ python3.6.1\lib\site-packages']服务器时间:星期五,2017年6月2日03:30:58 + 0000`TemplateDoesNotExist at/index /
settings.py:
ROOT_URLCONF = 'guest.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
Run Code Online (Sandbox Code Playgroud)
views.py:
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request,"index.html")
Run Code Online (Sandbox Code Playgroud)
PyCharm的屏幕截图:

我已经尝试了StackOverflow上提供的一些方法,但它们不起作用.这个例外是由错误的dirs引起的吗?我该如何处理这种情况?