我在Ubuntu 10.10上使用Django 1.2.4。我試圖覆蓋管理模塊的index.html模板。我一直在關注這些instructions。我也看過這question,但我仍然有困難。難度覆蓋Django管理模板
的說明說,在模板目錄下創建一個目錄admin
:
templates/
admin/
index.html
我想覆蓋在index.html
單塊。 (真的,我想要做的是一些文本追加到尾部難道還有比副本更簡單的方法/粘貼整個塊和改變它。?)(更新:看起來像{{block.super}}
可能有幫助。)
要我正在重寫信號,我把這個在我index.html
的頂部:
{% extends "admin/index.html" %}
當然,這導致堆棧溢出(從終端):
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
什麼是正確的如何做到這一點?我在鏈接問題上對每個答案嘗試了一個符號鏈接,但導致如下結果:
[email protected]:~/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
我在做什麼錯?
乾淨的解決方案! – 2012-05-24 08:13:30