python - 在 HTML 网站中集成 Django 博客项目
问题描述
我有一个常规网站,其中使用了 、HTML5
和静态图像。我也写了一个博客,我想将它集成到网站中。我真的很陌生,所以我想知道哪个是最好的使用方法。我应该将网站代码集成为项目的一部分还是有其他一些解决方案?谢谢!CSS3
JQUERY
Django
Django
Django
解决方案
您可以使用 Django 模板。模板定义了占位符和各种基本逻辑(模板标签),用于规范文档的显示方式。通常,模板用于生成 HTML,但 Django 模板同样能够生成任何基于文本的格式。如果您使用过像''这样的模板引擎。它们看起来有点相似。
<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,<br />{{ company }}</p>
</body>
</html>
在此处查看更多详细信息https://djangobook.com/django-templates/
推荐阅读
- python - 格式化 URL 的正确 python/django 方式是什么?
- html - 填充最后一个块的空闲空间
- javascript - 迭代深度嵌套的 JSON
- scala - ZIO Streams:ZSink 和 ZTransducer 有什么区别?
- go - 数学/大:常量 18446744073709551616 溢出 int?
- python - Python Django Post 请求垃圾邮件预防
- glsl - 不正常处理obj文件
- python -
, ValueError("could not convert string to float: 'X'"), - javascript - 无法 npm 链接本地依赖项
- c# - 尝试从 ASP.NET Core 5 Web 应用程序运行 Api 控制器功能时找不到 404