I \已經得到了類似這個話題的一個問題Django-MPTT, how toDjango-mptt錯誤。找不到管理員/ mptt_change_list.html模板
我已經添加了 'MPTT' 到INSTALLED_APPS
但鋼我有這樣的錯誤
TemplateDoesNotExist at /admin/app/category/
admin/mptt_change_list.html
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/app/category/
Django Version: 1.6.5
Exception Type: TemplateDoesNotExist
Exception Value:
admin/mptt_change_list.html
Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/loader.py in find_template, line 131
Python Executable: /usr/bin/python
Python Version: 2.7.6
看來,模板是不是它的路徑,但MPTT已正確安裝,並在PYTHONPATH
Template-loader postmortem
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
Using loader django.template.loaders.app_directories.Loader:
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin/mptt_change_list.html (File does not exist)
/usr/local/lib/python2.7/dist-packages/django/contrib/auth/templates/admin/mptt_change_list.html (File does not exist)
/home/islam/DM/repo/dm/DM-165/app/templates/admin/mptt_change_list.html (File does not exist)
/usr/local/lib/python2.7/dist-packages/debug_toolbar/templates/admin/mptt_change_list.html (File does not exist)
你能告訴我們你是如何安裝MPTT? –
@rajasimon,我按照文檔(http://django-mptt.github.io/django-mptt/install.html)從這裏下載了zip(https://pypi.python.org/pypi/django -mptt /),然後提取數據並嘗試這個命令「sudo python setup.py install」。它已經安裝,但沒有工作。然後,我已經嘗試過「pip install django-mptt --upgrade」 – opportunity356
ok cool ..檢查pip freeze如果mptt在那裏,然後安裝應用程序絕對加載模板。 –