Question

I'm using Grappelli with Django. When I follow the procedure as outlined in the Django docs to override a specific template for a specific model, it appears that Django (or Grappelli??) are struggling to render the template correctly.

I have copied the change_form.html file to the templates directory with the following subpath:

admin/properties/Calendar

where properties is the name of the app and Calendar is the name of the model for which I want to override the change form. Now the following appears

enter image description here

At least two things are not rendered correctly:

  • The breadcrumb bar is much thinner and the crumbs are tightly aligned with the left border of the bar.

  • The link for the history of changes is in the wrong place (it appears on the left), has the wrong style (no rounded edges) and appears twice.

I double checked that the correct template file is used by Django, so the mechanism as documented works albeit with the above described flaws. When I rename the duplicated template file or delete it from my app, everything looks fine again.

Before I dive into this, I was hoping someone could hint at what is going wrong here. All not overridden templates seem to work just fine.

Was it helpful?

Solution

From what I read I suspect you copy the default admin change_form.html template and not the grapelli version, found at grappelli/templates/admin/change_form.html.

If you want to override a grapelli template, then you should use that as source!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top