0
Uber simple app。私のviews.py:Djangoテンプレートのルックアップがアプリで表示されません
from django.http import HttpResponse
from django.shortcuts import render
from django.template import loader
def index(request):
#return HttpResponse("Ready to turn some webpages into workflowies?")
template = loader.get_template('web/index.html')
return HttpResponse(template.render(context, request))
私はレンダリングする私の最初のテンプレートを取得しようとしている、と私は/
Template-loader postmortem
Django tried loading these templates, in this order:
Using engine django:
django.template.loaders.app_directories.Loader: C:\utils\python\Python34\lib\site-packages\django\contrib\admin\templates\web\index.html (Source does not exist)
django.template.loaders.app_directories.Loader: C:\utils\python\Python34\lib\site-packages\django\contrib\auth\templates\web\index.html (Source does not exist)
しないのはなぜで
TemplateDoesNotExistを取得ローダーは
/web/templates/index.html
にテンプレートを見つけますか?
IMOローダは '/テンプレート/ウェブ/ index.html' – Leonard2
あなたがロードされている' 'ウェブ/ index.html''を探しますが、 '/ web/templates/index.html'が必要です。 'web'がアプリの場合、' settings.py'の 'INSTALLED_APPS'にそれを追加する必要があります。また、テンプレートのディレクトリ構造は 'web/templates/web/index.html'でなければなりません。 – AKS