Django-mptt like

Hey, I just installed django-mptt lib, but I don’t know how to make it work :(

I added

from mptt.models import MPTTModel

class Category(MPTTModel):
    slug = models.SlugField(max_length=200, unique=True)
    name = models.CharField(max_length=100)
    parent = models.ForeignKey('self', blank=True, null=True, related_name='child')

It works well

-

But when I go to the Django admin page of my site, I received an error message:

TemplateDoesNotExist at / admin / search / category /

admin / mptt_change_list.html

+5
source share
5 answers

The inclusion of this error message led me here.

In my case, the solution was to simply add 'mptt' to INSTALLED_APPS for the template loader to find admin / mptt_change_list.html

+11
source

pip install django-mptt --upgradesolved the problem for me. There is a closed question here: https://github.com/django-mptt/django-mptt/issues/23

+3

Had the same problem as mptt installed with easy_install. Force unpack:

easy_install - always-unzip django-mptt-0.5.5.tar.gz

+1
source

I managed to get the same error (0.5.5). You should also add 'django_mptt_admin' to INSTALLED_APPS.

Phillip.

0
source

In settings.py from Django 1.4, TEMPLATE_LOADERS had eggs.Loader commented out by default.

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
  # 'django.template.loaders.eggs.Loader',
)

Uncommenting eggs.Loader allowed four admin templates stored in

python/virtenv/lib/python2.7/site-packages/django_mptt-0.7.4-py2.7.egg

.

0
source

All Articles