Is there a way 开发者_Go百科to add custom views to the Django admin app?
To be specific, I would like to be able to switch out the "content" div for custom static content, while preserving the "header" and "footer" divs. This is different than redirecting to a static HTML page, which would not preserve the header and footer.
You just configure your view as usual (urls.py -> myapp.views) and then extend the admin base template:
{% extends "admin/base_site.html" %}
{% block content %}
My content looking like the rest of the admin app.
{% endblock %}
Here is a small intro http://www.djangobook.com/en/1.0/chapter17/, I think where is new version, but I think where is nothing changed in concept of extending admin pages.
精彩评论