Note that there are some explanatory texts on larger screens.

plurals
  1. PODifficulty overriding Django Admin template
    primarykey
    data
    text
    <p>I'm using Django 1.2.4 on Ubuntu 10.10. I'm trying to override the index.html template for the admin module. I've been following these <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates" rel="nofollow noreferrer">instructions</a>. I also looked at this <a href="https://stackoverflow.com/questions/2993233/cannot-extend-django-1-2-1-admin-template">question</a>, but I'm still having difficulty.</p> <p>The instructions say to create an <code>admin</code> directory in the templates directory:</p> <pre><code>templates/ admin/ index.html </code></pre> <p>I want to override a single block in the <code>index.html</code>. (Really, all I want to do is append some text to the end. Is there an easier way than copy/pasting the entire block and changing it?) (<strong>Update</strong>: Looks like <code>{{block.super}}</code> may help.)</p> <p>To signal that I'm overriding, I put this at the top of my <code>index.html</code>:</p> <pre><code>{% extends "admin/index.html" %} </code></pre> <p>Of course, that results in a stack overflow (from the terminal):</p> <pre><code>Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in &lt;type 'exceptions.RuntimeError'&gt; ignored </code></pre> <p>What is the correct way to do this? I tried a symlink per an answer on the linked question, but that resulted in the following:</p> <pre><code>me@mycomp:~/foo$ sudo ln -s /usr/local/lib/python2.6/dist-packages/django/contrib/admin/templates/ django_admin [sudo] password for me: ln: creating symbolic link `django_admin': Protocol error </code></pre> <p>What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload