আমি একটি লাইন দিয়ে মন্তব্য করতে চাই
{% if something.property %}
<table>
<tr>...
{% # this is a comment %}
{% if something.property %}
<table>
<tr>...
আমি একটি লাইন দিয়ে মন্তব্য করতে চাই
{% if something.property %}
<table>
<tr>...
{% # this is a comment %}
{% if something.property %}
<table>
<tr>...
উত্তর:
মাইলসের উত্তর হিসাবে, {% comment %}...{% endcomment %}
বহু-লাইন মন্তব্যের জন্য ব্যবহৃত হয়, তবে আপনি একই লাইনে পাঠ্য মন্তব্যও করতে পারেন:
{# some text #}
মন্তব্য ট্যাগগুলি https://docs.djangoproject.com/en/stable/ref/templates/builtins/#std:templatetag-comment এ নথিভুক্ত করা হয়েছে
{% comment %} this is a comment {% endcomment %}
একক লাইন মন্তব্য https://docs.djangoproject.com/en/stable/topics/templates/#comments এ নথিভুক্ত করা হয়েছে
{# this won't be rendered #}
এই জাতীয় প্রথাগত এইচটিএমএল মন্তব্যের বিপরীতে :
<!-- not so secret secrets -->
জ্যাঙ্গো টেমপ্লেট মন্তব্য চূড়ান্ত এইচটিএমএলে রেন্ডার করা হয় না। সুতরাং আপনি নিখরচায় সেখানে স্টাফ বাস্তবায়ন বিশদ বিবরণ করতে পারেন:
মাল্টি লাইন:
{% comment %}
The other half of the flexbox is defined
in a different file `sidebar.html`
as <div id="sidebar-main">.
{% endcomment %}
সপ্তাহের দিন:
{# jquery latest #}
{#
beware, this won't be commented out...
actually renders as regular body text on the page
#}
আমি <a href="{% url 'view_name' %}"
এখনও এটি তৈরি করা হয়নি এমন দৃশ্যের জন্য বিশেষত সহায়ক বলে মনে করি।
জ্যাঙ্গো টেমপ্লেটগুলিতে একাধিক মন্তব্য নিম্নরূপ ব্যবহার করুন: html ইত্যাদির জন্য use
{% comment %} All inside this tags are treated as comment {% endcomment %}
{% extends "file.html" %}
ট্যাগ থাকে তবে এটি টেমপ্লেট ফাইলের একেবারে শীর্ষে রাখা উচিত{% comment %}
...{% endcomment %}
অন্যথায় আপনি একটি<ExtendsNode: extends "file.html"> must be the first tag in the template
ত্রুটি পাবেন। আমি বলছি যে কেউ যদি টেমপ্লেটের শীর্ষে মাল্টি-লাইন মন্তব্য রাখতে চান।