HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Comments allows you to have sections of code that should be ignored
Comments allows you to have sections of code that should be ignored.
<h1>Welcome Everyone</h1>
{% comment %}
<h1>Welcome ladies and gentlemen</h1>
{% endcomment %}
You can add a message to your comment, to help you remember why you wrote the comment, or as message to other people reading the code.
Add a description to you comment:
<h1>Welcome Everyone</h1>
{% comment "this was the original welcome message" %}
<h1>Welcome ladies and gentlemen</h1>
{% endcomment %}
You can also use the {# ... #}
tags when commenting out code, which can be easier when
for smaller comments:
Comment out the word Everyone:
<h1>Welcome{# Everyone#}</h1>
Views are written in Python, and Python comments are written with the
#
character:
Comment out a section in the view:
from django.http import HttpResponse
from django.template import loader
def testing(request):
template = loader.get_template('template.html')
#context = {
# 'var1': 'John',
#}
return HttpResponse(template.render())
Read more about Python Comments in out Python Comment Tutorial.