我使用grappelly插件。当我尝试打开管理页面(/ admin)时,我得到了TemplateSyntaxError。 它说'get_generic_relation_list'是无效的块标记。
TemplateSyntaxError at /admin/
Invalid block tag: 'get_generic_relation_list', expected 'endblock'
Request Method: GET
Request URL: http://DOMAIN_NAME/admin/
Django Version: 1.4
Exception Type: TemplateSyntaxError
Exception Value:
Invalid block tag: 'get_generic_relation_list', expected 'endblock'
Exception Location: /opt/python27/django/1.4/lib/python2.7/site-packages/django/template/base.py in invalid_block_tag, line 320
Python Executable: /opt/python27/django/1.4/bin/python
Python Version: 2.7.0
Python Path:
['/home/vhosts/DOMAIN_NAME/httpdocs/media',
'/home/vhosts/DOMAIN_NAME/private/new_malinnikov/lib',
'/home/vhosts/DOMAIN_NAME/httpdocs/',
'/home/vhosts/DOMAIN_NAME/private/new_malinnikov',
'/home/vhosts/DOMAIN_NAME/private/new_malinnikov',
'/home/vhosts/DOMAIN_NAME/private',
'/opt/python27/django/1.4',
'/home/vhosts/DOMAIN_NAME/httpdocs',
'/opt/python27/django/1.4/lib/python2.7/site-packages/setuptools-0.6c12dev_r88846-py2.7.egg',
'/opt/python27/django/1.4/lib/python2.7/site-packages/pip-0.8.1-py2.7.egg',
'/opt/python27/django/1.4/lib/python27.zip',
'/opt/python27/django/1.4/lib/python2.7',
'/opt/python27/django/1.4/lib/python2.7/plat-linux2',
'/opt/python27/django/1.4/lib/python2.7/lib-tk',
'/opt/python27/django/1.4/lib/python2.7/lib-old',
'/opt/python27/django/1.4/lib/python2.7/lib-dynload',
'/opt/python27/lib/python2.7',
'/opt/python27/lib/python2.7/plat-linux2',
'/opt/python27/lib/python2.7/lib-tk',
'/opt/python27/django/1.4/lib/python2.7/site-packages',
'/opt/python27/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/opt/python27/lib/python2.7/site-packages/flup-1.0.3.dev_20100525-py2.7.egg',
'/opt/python27/lib/python2.7/site-packages/virtualenv-1.5.1-py2.7.egg',
'/opt/python27/lib/python2.7/site-packages/SQLAlchemy-0.6.4-py2.7.egg',
'/opt/python27/lib/python2.7/site-packages/SQLObject-0.14.1-py2.7.egg',
'/opt/python27/lib/python2.7/site-packages/FormEncode-1.2.3dev-py2.7.egg',
'/opt/python27/lib/python2.7/site-packages/MySQL_python-1.2.3-py2.7-linux-x86_64.egg',
'/opt/python27/lib/python2.7/site-packages/psycopg2-2.2.2-py2.7-linux-x86_64.egg',
'/opt/python27/lib/python2.7/site-packages/pysqlite-2.6.0-py2.7-linux-x86_64.egg',
'/opt/python27/lib/python2.7/site-packages',
'/opt/python27/lib/python2.7/site-packages/PIL']
Server time: Вск, 7 Окт 2012 04:19:42 +0700
Error during template rendering
在模板/home/vhosts/DOMAIN_NAME/httpdocs/templates/grappelli/admin/base.html中,第28行出错 无效的块标记:'get_generic_relation_list',预期'endblock'
18 <!--[if lt IE 8]>
19 <script src="http://ie7-js.googlecode.com/svn/version/2.0(beta3)/IE8.js" type="text/javascript"></script>
20 <![endif]-->
21 {% block javascripts %}
22 <script type="text/javascript" src="{% admin_media_prefix %}jquery/jquery-1.3.2.min.js"></script>
23 <script type="text/javascript" src="{% admin_media_prefix %}js/admin/Bookmarks.js"></script>
24 <script type="text/javascript">
25 // Admin URL
26 var ADMIN_URL = "{% get_admin_url %}";
27 // Generic Relations
28 {% get_generic_relation_list %}
29 // Get Bookmarks
30 $(document).ready(function(){
31 $.ajax({
32 type: "GET",
33 url: '{% url grp_bookmark_get %}',
34 data: "path=" + escape(window.location.pathname + window.location.search),
35 dataType: "html",
36 success: function(data){
37 $('ul#bookmarks').replaceWith(data);
38 }
答案 0 :(得分:0)
是的,谢谢,我已经知道了。我使用了grappelli 2.4版本,但我需要2.0版本。