แก้ไขแล้ว: คำแนะนำโค้ด html ไม่ทำงานใน django-html

การปรับปรุงครั้งล่าสุด: 09/11/2023
ผู้แต่ง: หลาม SourceTrail

ปัญหาหลักคือ Django-HTML ไม่รองรับการเรนเดอร์ไฟล์ HTML จากบรรทัดคำสั่ง

5-appcache

I'm using Django 1.8 and django-html5-appcache 0.4.1, and I have the following code in my template:
<code>{% load appcache %}
&lt;!DOCTYPE html&gt;
&lt;html manifest="{{ STATIC_URL }}manifest.appcache" {% html5_appcache %}&gt;
</code>
However, when I type <code>manifest=</code>, the code suggestion doesn't work: it doesn't suggest <code>{{ STATIC_URL }}manifest.appcache</code>.  It does work if I type <code>manifest="{{ STATIC_URL }}</code>, but then it doesn't suggest <code>manifest.appcache</code>.  How can I get it to suggest both?

โค้ดไลน์ {% load appcache %} โหลดไลบรารีแท็กเทมเพลต Django appcache

โค้ดไลน์ <html manifest="{{ STATIC_URL }}manifest.appcache" {% html5_appcache %}> ตั้งค่าแอตทริบิวต์ manifest ของแท็ก html เป็นค่าของตัวแปร STATIC_URL ซึ่งเชื่อมกับ “manifest.appcache” แท็กเทมเพลต {% html5_appcache %} ใช้เพื่อเพิ่มความคิดเห็นที่ระบุว่าหน้านั้นถูกแคชโดยใช้ HTML5 AppCache

ฉันจะเติมข้อความอัตโนมัติทั้ง HTML และ Django-HTML ได้อย่างไร

ไม่มีวิธีในตัวในการเติมข้อความอัตโนมัติทั้ง HTML และ Django-HTML ใน Django อย่างไรก็ตาม คุณสามารถใช้ไลบรารีของบุคคลที่สาม เช่น django-html5lib หรือ html5lib เพื่อเติมข้อความอัตโนมัติทั้ง HTML และ Django-HTML

กระทู้ที่เกี่ยวข้อง: