settings.py에서 sqlite3을 실행하고이 데이터베이스의 이름을 database.db로 지정했습니다. index.html을이Django v1.5, TemplateDoesNotExist 오류
# -*- coding:UTF-8 -*-
from django.shortcuts import render_to_response
def oneView(request):
return render_to_response("index.html", {"content":"Hello World, from oneView"})
def anotherView(request):
return render_to_response("index.html", {"content":"Hello Again, from anotherView"})
내 디렉토리 블로그/blog_app/템플릿/index.html을처럼
from blog_app.views import oneView, anotherView
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^one/$', oneView),
url(r'^another/$', anotherView),
# Examples:
# url(r'^$', 'django_project.views.home', name='home'),
# url(r'^django_project/', include('django_project.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)
는 내 views.py 보인다. 왜냐하면 표준 설정 파일은 다음과 같이 말하고 있기 때문입니다 :
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
내 index.html 파일을 찾을 수 없다는 것이 이상하다고 생각합니다. 올바른 디렉토리를 찾지 못했습니까? 내가 어떤 아이디어 127.0.0.1:8000/one/ 또는 127.0.0.1:8000/another/
로 이동하려고 할 때
그럼에도 불구하고, 나는 단지 오류에 "/ 일 /에 TemplateDoesNotExist"를 얻을?
감사를 위해이 공간을 사용해서는 안되지만 익명의 사용자 이름과 함께 완벽한 답을 제공합니다. 이제 작동합니다. U 락 – Dolcens
@Dolcens 대답은 귀하의 디렉토리 구조에 대한 나의 해석에 따른 것입니다 .. 작동하지 않는다면 장고 애플리케이션 – Ishan070692
의 구조를 제공하십시오. upvote ..를 잊지 마세요. 스택 오버플로에 대해 조금 새로운 것 같습니다. – Ishan070692