khashashin
khashashin

Reputation: 1127

I get error TemplateDoesNotExist

I've added an app to my side bar in wagtail admin, but if I click on it I get this error

enter image description here

My model.py:

class TeamRoosterTwo(models.Model):
    team_name = models.CharField(max_length=100, default="")
    team_logo = models.ForeignKey(
        'wagtailimages.Image',
        null=True, blank=True,
        on_delete=models.SET_NULL,
        related_name='+'
    )
    staff = StreamField([
        ('staff', CardsBlock(Staff(), icon="plus")),
    ], blank=True)
    spieler = StreamField([
        ('spieler', CardsBlock(Spieler(), icon="user")),
    ], blank=True)



    content_panels = [
        FieldPanel('team_name', classname="col12"),
        ImageChooserPanel('team_logo'),
        StreamFieldPanel('staff'),
        StreamFieldPanel('spieler'),
    ]

    def __str__(self):
        return self.team_name

And i have created wagtail_hooks.py with following code:

from wagtail.contrib.modeladmin.options import (
    ModelAdmin, modeladmin_register)
from . models import TeamRoosterTwo

class TeamRoosterModelAdmin(ModelAdmin):
    model = TeamRoosterTwo
    menu_label = 'Treichle Cup'
    menu_icon = 'group'
    menu_order = 200
    exclude_from_explorer = True

modeladmin_register(TeamRoosterModelAdmin)

enter image description here

Upvotes: 0

Views: 165

Answers (1)

gasman
gasman

Reputation: 25227

You probably missed adding wagtail.contrib.modeladmin to INSTALLED_APPS: http://docs.wagtail.io/en/v1.13.1/reference/contrib/modeladmin/index.html#installation

Upvotes: 1

Related Questions