Home > Back-end >  how to completely remove the recent action panel from Django admin UI
how to completely remove the recent action panel from Django admin UI

Time:09-16

how to completely remove the recent action panel from Django admin UI

I have done a lot of searching and all leads to how to clear the data in the panel from the database .. but what am looking to do is completely remove the panel from my admin Userinteraface .. any help on how to do this?

what I've tried : tried to override the base_site.html for the admin and it worked for override colors and styles and other blocks but not working with the sidebar block

{% extends "admin/base.html" %}
{% load i18n static %}

{% block title %}{{ title }} | {% trans "G-Attend" %}{% endblock %}
{% block extrastyle %}
<link rel="stylesheet" type="text/css" href="{% static 'custom_admin_styles/admin_override.css' %}">
{% endblock %}
{% block branding %}
    <h1 id="site-name">
        <b style="color: #1f76bc;size: 80;">
            G
        </b> Attend </h1>
{% endblock %}
{% block sidebar %}
<div id="content-related">

</div>
{% endblock %}

{% block nav-global %}{% endblock %}

enter image description here

CodePudding user response:

To override the Django admin side bar

You nee to extends admin/base_site.html

{% extends "admin/base_site.html" %}
{% load i18n static %}

<!-- -->

{% block sidebar %}
<div id="content-related">
    Your custom side bar here.
</div>
{% endblock %}

NB : Inside your templates folder, you should have created an admin subfolder. And place the custom .html file in it.

More info Here

CodePudding user response:

The right solution for this was like :

creating a file called index.html inside my templates/admin/ directory , then inside the HTML file I used this code :

{% extends "admin/index.html" %}

{% block sidebar  %}
{% endblock %}

so I need to extend index.html instead of base_site.html

  • Related