简体   繁体   English

django cms中的占位符错误

[英]placeholder error in django cms

I am using django-cms to design a cms site,i had configured everything and working fine.but when i tried to use placeholder tag, its displaying errors 我正在使用django-cms设计一个cms网站,我已经配置了所有东西并且工作正常。但是当我尝试使用placeholder标记时,其显示错误

suppose i had the base.html code as below 假设我有如下的base.html代码

{% load cms_tags sekizai_tags menu_tags %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
     <title>Welcome to Services</title>
</head>
<body>
   {% cms_toolbar %}
   <div class='new'> 
      {% block base_content %}{% endblock %} 
   </div> 
</body>
</html>

And i am trying to render home.html with below code 我试图用下面的代码渲染home.html

{% extends "base.html" %}
{% load cms_tags menu_tags sekizai_tags %}

{% block base_content %}
  {% placeholder 'terms_and_conditions' %}
     <p>This is the placeholder of editing the data</p>
  {% endplaceholder %}
{% endblock %}

I am getting the below errors when i refresh the page 刷新页面时出现以下错误

Exception Value:    
Invalid block tag: 'endplaceholder', expected 'endblock'
Exception Location: /usr/lib/python2.7/site-packages/django/template/base.py in invalid_block_tag, line 320

Can anyone please let me know whats wrong in the above html code and how to solve the above error 任何人都可以让我知道上面的html代码有什么问题以及如何解决上述错误

Edited 已编辑

Also when i uncommented admin.autodiscover() in urls.py i am getting a weird error as below 另外,当我在urls.py中取消注释admin.autodiscover() ,我得到如下奇怪的错误

Exception Value:  cannot import name plugin_pool
Exception Location: /usr/lib/python2.7/site-packages/cms/admin/__init__.py in <module>, line 7

And when i accessed the url http://localhost:8000/admin/ , its displaying 当我访问URL http://localhost:8000/admin/ ,其显示

"You had no permissions to edit anything"

Edited2 编辑2

Also i am not getting/unable to see editable mode even though after adding {% cms_toolbar %} in body tag 另外,即使在body tag添加了{% cms_toolbar %}之后,我也无法/无法看到可编辑模式

remove {% endplaceholder %} 删除{%endplaceholder%}

There is no such tag as a endplaceholder as specified in your error log 没有错误日志中指定的标记作为endplaceholder

Invalid block tag: 'endplaceholder', expected 'endblock' 无效的标签:“ endplaceholder”,预期为“ endblock”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM