# No Reverse Match

**URL:** <https://forum.djangoproject.com/t/no-reverse-match/26405>\
**Category:** Mystery Errors\
**Created:** [December 24, 2023, 11:50pm UTC](https://forum.djangoproject.com/t/no-reverse-match/26405 "2023-12-24T23:50:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![harkerbyte](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harkerbyte/32/17958_2.png) [@harkerbyte](https://forum.djangoproject.com/u/harkerbyte)\
**Post date:** [December 24, 2023, 11:50pm UTC](https://forum.djangoproject.com/t/no-reverse-match/26405/1 "2023-12-24T23:50:47Z")

</div>

I’ve created a view function post\_share(request, post\_id) :  
with  
post = get\_object\_or\_404(Post, id = post\_id)

Also in my url.py I’ve a path  
app\_name = ‘blog’  
path(‘int:post\_id/share/’, views.post\_share, name = “post share”)

Now I’m trying to render views.post\_share on my template  
{% url ‘blog:post\_share’ post.id %}

But getting an error that says "No Reverse Match at (page url)  
Reverse for ‘post\_share’ not found. ‘post\_share’ isn’t a valid view function.

How do I fix this issue? I’ve already cross checked the all the patterns name and view function name they all match.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 25, 2023, 3:16am UTC](https://forum.djangoproject.com/t/no-reverse-match/26405/2 "2023-12-25T03:16:40Z")

</div>

Your view is named “post share”, not “post\_share”.

You have defined it:

> [@harkerbyte](#):
>
> ```auto
> path(‘int:post_id/share/’, views.post_share, name = “post share”)
> ^^^^^^^^^^
> 
> ```

But are trying to access it as:

> [@harkerbyte](#):
>
> ```auto
> {% url ‘blog:post_share’ post.id %}
> ^^^^^^^^^^
> 
> ```

---

<div class="post-metadata">

**Author:** ![harkerbyte](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/harkerbyte/32/17958_2.png) [@harkerbyte](https://forum.djangoproject.com/u/harkerbyte)\
**Post date:** [December 25, 2023, 11:43am UTC](https://forum.djangoproject.com/t/no-reverse-match/26405/3 "2023-12-25T11:43:05Z")

</div>

I just noticed that… Thanks to you ❤
