我遇到了一个类似于这个主题Django-MPTT, how to的问题
我把'mptt‘加到INSTALLED_APPS上了
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app',
'south',
'mptt',
)但是钢,我有这个错误
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)发布于 2014-07-25 06:14:14
解决方案是使用sudo pip uninstall django-mptt删除mptt,然后使用pip:sudo pip install django-mptt --upgrade重新安装它。
发布于 2014-07-25 06:06:43
就我所知,您可以在那里安装任何python包,方法简单:
1.)
你可以像via那样
pip安装
<package Nmae>
有一段时间sudo pip install <packageName>也能工作
2.)
然后下载tar file并从您可以通过
python setup.py insatll
3.)
在这里你做了两个所以也试试这个东西
下载mptt folder并将其放入django项目中。希望这能起作用
https://stackoverflow.com/questions/24935521
复制相似问题