Hal*_*own 292
只打印当前年份的完整标签是{% now "Y" %}.请注意,Y必须用引号括起来.
hyg*_*ull 16
我在基于 Django 的网站中使用了以下内容
\n{% now 'Y' %}\nRun Code Online (Sandbox Code Playgroud)\n您可以在页脚部分访问并查看它,我使用下面的代码显示了当前年份(CSS 部分被省略,因此请使用您自己的代码)。
\n<footer class="container-fluid" id="footer">\n <center>\n <p>\n ©\n {% now 'Y' %}, \n PMT Boys hostel <br> \n All rights reserved\n </p>\n </center>\n</footer>\nRun Code Online (Sandbox Code Playgroud)\n它在我的网站页脚中显示以下居中文本。
\n\xc2\xa92018, PMT Boys hostel \nAll rights reserved\nRun Code Online (Sandbox Code Playgroud)\n