に達していないDjangoのテンプレートローダは、Djangoのドキュメントによると、アプリテンプレート
は、「プロジェクトのテンプレート設定は、Djangoはテンプレートをロードしてレンダリングする方法を説明します。デフォルトの設定ファイルは、そのAPP_DIRSオプションTrueに設定されているDjangoTemplatesバックエンドを設定します。慣例によりDjangoTemplatesはそれぞれのINSTALLED_APPSの "templates"サブディレクトリを探します。 "
マイメザニンsettings.pyは、この構成
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',
],
},
},
]
私のディレクトリ構造が
project
app_name
templates
app_name
index.html
である。しかし、テンプレートローダが
project
app_name
templates
Aで停止してい私のapp_nameテンプレートindex.htmlには達していません。何が問題なの?
Djangoを 'templates'ディレクトリ以外のディレクトリに再帰させる方法はありますか? – JTheboss
この[サイト](http://stackoverflow.com/questions/1740436/what-is-the-best-location-to-put-templates-in-django-project)を読むと、質問に答えるのに役立つかもしれませんが、あなたのアプリケーションディレクトリ内に 'templates'ディレクトリを作成することは、あなたのアプリケーション固有のテンプレートを保存するのに理想的です。 –