A
A
Alexander2016-04-01 09:11:32
Django
Alexander, 2016-04-01 09:11:32

In which file is the content given to the template?

I'm changing the admin template:
08dbeb6699504487ba4e30f6fc737689.png
I need to move this
Authentication and Authorization
.... block
to the left menu and that it stays there when going to any link.
The problem is that I can not find in which file where what is given. Maybe someone knows? (I use virtual env)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2016-04-03
@kentuck1213

Well, specifically on this form, this is given in django/contrib/admin/templates/index.html
Specifically in this place:

... 
{# тут пробегаемся по вашим приложениям и расставляем ссылки на админки #}
{% block content %}
<div id="content-main">
{% if app_list %}
    {% for app in app_list %}
       .....
    {% endfor %}
{% else %}
    <p>{% trans "You don't have permission to edit anything." %}</p>
{% endif %}
</div>
{% endblock %}
....

When switching to the application,
django/contrib/admin/templates/app_index.html is called (the content of index.html is inherited. Only in apps_list is now specifically your application)
When switching to a list of objects, the template
is called which inherits in turn base_site.html , and that one inherits base.html )
When moving to a specific object, the
is called, which also inherits base_site.html
In all of the listed templates, embed your elements

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question