Ash*_*ish 2 html python django
下面是我的工作区/项目名称/模板/应用名称中的 index.html 文件
<!DOCTYPE html>
<html>
<head>
<title>my news</title>
</head>
<body>
<h1>look below for news</h1>
{%if categories%}
<ul>
{%for category in categories%}
<li>{{category.name}}</li>
{%endfor%}
</ul>
{%endif%}
{%if headings%}
<p>
{%for heading in headings%}
<a href="#">{{heading.title}}</a>
<br>
{{heading.content}}
{%endfor%}
</p>
{%endif%}
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
问题是<ul>和<li>标签的工作,并显示是否应该do.the列表<a>标记也显示超链接,但<p>标签和<br>标签没有被渲染并正在显示为文本,不能认为可能是什么疑难问题。我对 Django 相当陌生。

| 归档时间: |
|
| 查看次数: |
2507 次 |
| 最近记录: |