[Django] #33492: Getting Errors for code that is commented

10 views
Skip to first unread message

Django

unread,
Feb 4, 2022, 12:23:46 AM2/4/22
to django-...@googlegroups.com
#33492: Getting Errors for code that is commented
-------------------------------------+-------------------------------------
Reporter: kmurray24 | Owner: nobody
Type: Bug | Status: new
Component: Template | Version: 4.0
system | Keywords: comments templates
Severity: Normal | error
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Should I be getting errors for code that is commented out?
i believe I've seen this in a couple of areas.
If I comment out the href shown below and execute run server it produces
an error"
django.urls.exceptions.NoReverseMatch: Reverse for 'register' not found.
'register' is not a valid view function or pattern name.

This is kind of a pain
Should I really be getting these errors?

{{{
{% extends 'base.html' %}

{% block title %}Login{% endblock %}

{% block content %}
<h2>Login</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>

<!-- <a href="{% url 'polls:register' %}" class="btn btn-primary btn-lg
active" role="button" aria-pressed="true">Go Home</a> -->
{% endblock %}
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33492>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 4, 2022, 12:38:30 AM2/4/22
to django-...@googlegroups.com
#33492: Getting Errors for code that is commented
-------------------------------------+-------------------------------------
Reporter: kmurray24 | Owner: nobody
Type: Bug | Status: closed
Component: Template system | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: comments templates | Triage Stage:
error | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

If you want to comment-out code in your templates you should use Django
[https://docs.djangoproject.com/en/stable/ref/templates/language/#comments
comments], not HTML comments. Please use one of
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels] if you have further questions.

--
Ticket URL: <https://code.djangoproject.com/ticket/33492#comment:1>

Reply all
Reply to author
Forward
0 new messages