B
B
Bjornie2017-10-07 16:36:29
Django
Bjornie, 2017-10-07 16:36:29

How to rewrite Django Admin Index (add context)?

For the admin panel of a specific application, I apply the following code (needed to connect the form) + rewrite the templates.

def changelist_view(self, request, extra_context=None):
        extra_context = extra_context or {}
        extra_context['report_popup_form'] = ReportPopupForm()
        return super(ReportAdmin, self).changelist_view(request, extra_context=extra_context)

Now there is a task to do the same, but for the main admin page (template admin/index.html). I already understood how to rewrite the template. And how to add context (according to the example above). - No. Tell me how it's done?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question