找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2803|回复: 0

[求助] 用Django在页面中创建按钮但变成了字符???

1

主题

3

帖子

3

积分

贫民

积分
3
Raune 发表于 2020-3-17 23:50:59 | 显示全部楼层 |阅读模式
  1. #  这是new_entry.html
  2. {% extends "learning_logs/base.html" %}

  3. {% block content %}
  4.   
  5.   <p>
  6.         <a href="{% url 'learning_logs:topic' topic.id %}">{{ topic }}</a>
  7.   </p>
  8.   
  9.   <p>Add a new entry:</p>
  10.   
  11.   <form action="{% url 'learning_logs:new_entry' topic.id %}" method='post'>
  12.     {% csrf_token %}
  13.     {{ form.as_p }}
  14. <font size="4">    <botton name='submit'>add entry</botton></font>
  15.   </form>
  16.   
  17. {% endblock content %}
复制代码
  1. #这是 new_topic.html
  2. {% extends "learning_logs/base.html" %}

  3. {% block content %}
  4.   <p>Add a new topic:</p>
  5.   
  6.   <form action="{% url 'learning_logs:new_topic' %}" method='post'>
  7.     {% csrf_token %}
  8.     {{ form.as_p }}
  9. <font size="4" face="Verdana">    <button name="submit">add topic</button></font>
  10.   </form>
  11.   
  12. {% endblock content %}
复制代码
如上,本来想创建一个提交按钮(位于new_entry.html),但是却变成了字符串渲染

new_topic.html作为对比,其中的按钮就创建成功了

实在是不知道为什么
求助!!!


1.jpg
2.jpg
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表