2017-10-21 6 views
0

サーバがテンプレートにリンクすることができないこの 'home.html' ファイルのための延長使用しかし一方で、正常に動作している「'TemplateDoesNotExist at /' djangoのエラー? 'home.html' は</p> <p>:

{%延びている/ template1を/個人/ header.html」%} ながらローディングはlocalhost:

`使用エンジンジャンゴ:

  1. django.template.loaders.app_directories.Loader:/ USR Djangoはこの順序で、これらのテンプレートをロードしようとしました/local/lib/python2.7/dist-packages/django/contrib/admin/templates/ffgg/home.html(ソースは存在しません)。
  2. django.template.loaders.app_directories.Loader:/usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/ffgg/home.html(ソースは存在しません) '
+2

[ジャンゴTemplateDoesNotExist?](https://stackoverflow.com/questions/1926049/django-templatedoesnotexist) – thatrockbottomprogrammer

+0

の可能性のある重複あなたのsettings.pyに – rollinger

+0

をTEMPLATE_DIRS変数の内容を投稿してくださいしないでください絶対パスを使用してください(テンプレートが実際にはそのディレクトリにあり、rootから始まっていない限り)。 – Evert

答えて

0

1)settings.pyのTEMPLATE_DIRS変数にあるものを確認してください。これはDjangoがあなたのテンプレートを見つけるためにすべてのアプリを検索するフォルダです。

2)先頭のスラッシュ削除してみてくださいにtemplate1がTEMPLATE_DIRSにある場合は、その後、 'アプリ/ template.htmlは' 十分だろう

{% extends 'template1/personal/header.html' %}

3)

{% extends 'personal/header.html' %}

読みますオン:

https://tutorial.djangogirls.org/en/template_extending/

https://docs.djangoproject.com/en/1.7/topics/templates/

関連する問題