no reversematch problem with my tutorial for django

The problem is in topics.html. Here’s the loop that shows each topic:

    {%for topic in topics%}
        <li>
            <a href="{% url 'learning_logs:topic' topic_id%}">{{topic}}</a>
        </li>
    {%empty%}
        <li>No topics have been added yet</li>
    {%endfor%}

The variable topic_id is not defined. That should be topic.id, which accesses the id attribute of topic.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top