내가했던 튜토리얼 "http://django-mptt.github.com/django-mptt/tutorial.html"ImportError를 : 이름 MPTTModel 가져올 수 없습니다
하지만 여전히 나에게 가져 오기 오류를주고, 내가 mptt에 존재하는 mptt에 대한 코드를 다시 확인하고 클래스 MPTTMODEL을 발견>의 단계 모델 파일 당신이 시도 할 수
Validating models...
Unhandled exception in thread started by <bound method Command.inner_run of <django.contrib.staticfiles.management.commands.runserver.Command object at 0x1ec4710>>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/commands/runserver.py", line 91, in inner_run
self.validate(display_num_errors=True)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/base.py", line 266, in validate
num_errors = get_validation_errors(s, app)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/core/management/validation.py", line 30, in get_validation_errors
for (app_name, error) in get_app_errors().items():
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/db/models/loading.py", line 158, in get_app_errors
self._populate()
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/db/models/loading.py", line 67, in _populate
self.load_app(app_name)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/db/models/loading.py", line 88, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.7/dist-packages/Django-1.4-py2.7.egg/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/kareemhashem/espace/sharek/core/models.py", line 12, in <module>
from mptt.models import MPTTModel, TreeForeignKey
ImportError: cannot import name MPTTModel
답변을 업데이트하고 Traceback –
이 @ César –
으로 업데이트되었습니다. 최근에이 게시물을 방문한 적이 있다면 아마 내가했던 것처럼 이전 자습서를 따라야 할 것입니다. django CMS 3.1 MPTT가 MP로 대체되었으므로 http://docs.django-cms.org/en/release-3.4.x/upgrade/3.1.html – Luke