# Reverse for 'topic\_posts' with arguments '(3, '')' not found.

**URL:** <https://forum.djangoproject.com/t/reverse-for-topic-posts-with-arguments-3-not-found/8498>\
**Category:** Using Django\
**Created:** [June 24, 2021, 11:05am UTC](https://forum.djangoproject.com/t/reverse-for-topic-posts-with-arguments-3-not-found/8498 "2021-06-24T11:05:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weiguo97](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/weiguo97/32/4953_2.png) [@weiguo97](https://forum.djangoproject.com/u/weiguo97)\
**Post date:** [June 24, 2021, 11:05am UTC](https://forum.djangoproject.com/t/reverse-for-topic-posts-with-arguments-3-not-found/8498/1 "2021-06-24T11:05:44Z")

</div>

The reverse of '‘topic\_posts’ works fine in other places. But it doesn’t work here.  
HTML file

```auto
<td class="align-middle">
    {% with post=board.get_last_post %}
         <small>
               <a href="{% url 'topic_posts' board.id post.topic.id %}">
                   By {{ post.created_by.username }} at {{ post.created_at }}
                   id - {{ board.id }} {{ post.topic.id }}
                </a>
          </small>
   {% endwith %}
</td>

```

url setting

```auto
path('boards/<int:board_id>/topics/<int:topic_id>/', views.topic_posts, name='topic_posts'),

```

```auto
def topic_posts(request, board_id, topic_id):
    topic = get_object_or_404(Topic, board_id=board_id, id=topic_id)
    return render(request, 'topic_posts.html', {'topic': topic})

```

When I changed the `board.id` and `post.topic.id` to integer value , for exmaple 1 and 24, the web would render. I commented `<a href="{% url 'topic_posts' board.id post.topic.id %}"> ` and added `{{ board.id }} {{ post.topic.id }}` to see if there is an error with the query, turned out there is no problem, it would render 1, 24 on the webpage. Then I tried `<a href="{% url 'topic_posts' board.id 24 %}">` It worked fine, but ` <a href="{% url 'topic_posts' board.id post.topic.id %}">` still won’t work.  
Thanks for reading!

---

<div class="post-metadata">

**Author:** ![weiguo97](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/weiguo97/32/4953_2.png) [@weiguo97](https://forum.djangoproject.com/u/weiguo97)\
**Post date:** [June 24, 2021, 1:09pm UTC](https://forum.djangoproject.com/t/reverse-for-topic-posts-with-arguments-3-not-found/8498/2 "2021-06-24T13:09:57Z")

</div>

The problem is figured out. Post closed.
