Extending the Django Admin with images
django.db.models.Model defines an app_label which can be changed within a Model by 开发者_开发知识库appending:
class Meta:
app_label = "something"
Now I am trying to find a not too hacky/pythonic way to let each app have an image. I don't really want to break into the django contrib stuff, because that tends to get complicated.. Is it possible to do something within the package's __init__
file possibly?
Any hint would be welcome
You shouldn't change app_label for model, this value is not only used for admin and changing it can break things badly.
If you want to change admin index page presentation then override the admin template (see https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#overriding-admin-templates ) and put the HTML and logic you want.
It may be easier to accomplish your task with django-admin-tools by creating custom dashboard module.
精彩评论