Search code examples
djangodjango-admindjango-templates

Change row colour in Django Admin List


I want to highlight rows (set the backgorund colour) in the Django Admin page (change_list.html) based on a field in the model called status. What is the best way to do this?

I have 3 statuses. Open, Active, Closed. I'd like rows with open to be green, active to be orange and closed to be red.

I've found documentation about changing the templates so but not sure how to check the status to colour the row.


Solution

  • Check out django-liststyle, exactly what you're after.