さて、Djangoで「インクルージョン」を使おうとすると、自分では解決できない混乱した問題に遭遇しました。
私のプロジェクトには構造があります。
MyProject---
App1---
__init__.py
models.py
test.py
urls.py
views.py
App2---
...
template---
App1---
some htmls
App2---
...
templatetags---
__init__.py
inclusion_cld_tags.py
manage.py
urls.py
__init__.py
settings.py
私はsettings.pyにtemplatetagsフォルダーを登録しました(インストールされたAPPSとTEMPLATE_DIRSの両方)。しかし、HTMLで{%load include_test%}を使用すると、次のような例外が発生します。
'inclusion_cld_tags' is not a valid tag library: Could not load template library from django.templatetags.inclusion_cld_tags, No module named inclusion_cld_tags
インポート作業に問題はないと思いますが、どうすればよいですか?
手伝ってくれてありがとう!
私のdjangoバージョン:1.0+私のPythonバージョン:2.6.4