次のプロジェクトがあるとします。
myproject/
myproject/
__init__.py
settings.py
urls.py
wsgi.py
templates/
base.html
app1/
__init__.py
admin.py
models.py
urls.py
views.py
templates/
base.html
index.html
他のすべてのアプリが使用するベース テンプレートをmyproject/template/base.html
.
次に、アプリ テンプレートを に入れたいと思いapp/templates
ます。
1 つのオプションは、myproject/settings.py に書き込むことです。
TEMPLATE_DIRS = (
"/dir/to/myproject/myproject/templates",
"/dir/to/myproject/app1/templates",
)
しかし、これはそれを行うための最良の方法ですか?