Opened 3 years ago

Closed 3 years ago

#33492 closed Bug (invalid)

Getting Errors for code that is commented

Reported by: Ken Murray Owned by: nobody
Component: Template system Version: 4.0
Severity: Normal Keywords: comments templates error
Cc: ken@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 %} 


Change History (1)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: invalid
Status: newclosed

If you want to comment-out code in your templates you should use Django comments, not HTML comments. Please use one of support channels if you have further questions.

Note: See TracTickets for help on using tickets.
Back to Top