<html>
<head>
<title>Ordering notice</title>
</head>
<body>
<h1>Ordering notice</h1>
<p>Dear {{ person_name }},</p>
<p>Thanks for placing an order from {{ company }}. It's scheduled to ship on {{ s\
hip_date|date:"F j, Y" }}.</p>
<p>Here are the items you've ordered:</p>
<ul>
{% for item in item_list %}
<li>{{ item }}</li>{% end for %}
</ul>
{% if ordered_warranty %}
<p>Your warranty information will be included in the packaging.</p>
{% else %}
<p>
You didn't order a warranty, so you're on your own when the products inevitably stop working.
</p>
{% endif %}
<p>Sincerely, {{ company }}</p>
</body>
</html>
2 回答
您有两种方法可以将当前站点与Django集成 .
1)您可以使用
DjangoRestFramework
编写API
并使用jQuery
AJAX
发出请求以从Django获取内容 .2)您可以使用当前的
HTML
文件作为Django
项目模板来呈现Django
中的内容 .您可以使用Django模板 . 该模板定义了占位符和各种基本逻辑(模板标签),用于管理文档的显示方式 . 通常,模板用于生成HTML,但Django模板同样能够生成任何基于文本的格式 . 如果你使用了像''这样的模板引擎 . 他们看起来有点相似 .
点击这里查看更多详情https://djangobook.com/django-templates/