# NoReverseMatch at /Laptops/LenovoLaptops/

**URL:** <https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480>\
**Category:** Mystery Errors\
**Created:** [March 13, 2023, 4:33pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480 "2023-03-13T16:33:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 4:33pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/1 "2023-03-13T16:33:53Z")

</div>

Hi ,  
I am getting the above error. Please help me out on this.  
Details are as follows:

````auto
    path('LaptopsPage/', views.laptops, name='LaptopsPage'),
    path('LenovoLaptops/', views.LenovoLaptopListView, name = 'LenovoLaptopLink'),
    path('Load_Lenovo_Laptops/',views.Load_More_Lenovo_Laptops, name='Load_Lenovo_Laptops'),
    path("LenovoLaptops/<str:Model_Name>/", views.Lenovo_Laptop_Details.as_view(), name='Lenovo_Laptop_Details'),```

views.py
```def LenovoLaptopListView(request):
    Lenovo_dictionary = Laptop_Feature_Columns.objects.filter(Brand='Lenovo')[0:30]
    Lenovo_Product_Count = Laptop_Feature_Columns.objects.filter(Brand='Lenovo').count()
    return render (request, 'LaptopApp/Lenovo_Laptop.html', context={'Lenovo_dictionary':Lenovo_dictionary, 'Lenovo_Product_Count':Lenovo_Product_Count})

class Lenovo_Laptop_Details(ListView):
    model = Laptop_Feature_Columns
    template_name = 'LaptopApp/Lenovo_Laptop_Details.html'
    context_object_name = 'Lenovo_Laptop_Detail_Specification'
    def get_queryset(self):
        # self.Model_Name = kwargs.get('Model_Name', "any_default")
        Laptop_Feature_Columns.objects.filter(
            Model_Name=self.kwargs['Model_Name']).update(No_Of_Hits=F('No_Of_Hits') + 1)
        return 
        Laptop_Feature_Columns.objects.filter(Model_Name=self.kwargs['Model_Name'])```

Lenovo_Laptop.html
``` <div class="Button_Panel">
                    <a href="{% url 'LaptopApp:Lenovo_Laptop_Details' Lenovo_Laptop_List.Model_Name %}" {{Lenovo_Laptop_List.Model_Name}} class="button"> Details </a>                
   </div>```
I understand that this question might have been asked many times, but somehow I am not able to resolve this issue.
Please try to help me out of this issue who can.
Thanks in Advance to all.
````

---

<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:** [March 13, 2023, 4:37pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/2 "2023-03-13T16:37:22Z")

</div>

Side note: When posting code here, enclose the code between lines of three backtick - ` characters. That means you will have a line of ```, then your code, then another line of ```. (When posting code from multiple files, it’s generally most useful to do this for each file individually.) This forces the forum software to keep your code properly formatted. This is also the recommended process when posting templates, error messages, and other pre-formatted text.

You don’t need to repost your code. Edit your original post and add the ``` before and after each file’s worth of code.

We’re also going to need the `Lenovo_Laptop_Details.html` template.

Also in the future please provide the complete traceback when requesting assistance with error messages.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 4:45pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/3 "2023-03-13T16:45:04Z")

</div>

Hi Sir,  
Lenovo\_Laptop\_Details.html is a very huge file. It is around some 4k lines of code and I have not done all the necessary changes there. Will that be fine if I still post it here, so that you can get some idea how my code is working.

---

<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:** [March 13, 2023, 4:49pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/4 "2023-03-13T16:49:42Z")

</div>

We can pass on the full file at the moment.

You’re really close with the backticks, but they need to be lines by themselves. You can’t put them at the beginning or end of lines with any other text.

I do need one item clarified. What view is being rendered when this error occurs? (Not the page that is currently being displayed, but the page that you are going to when the error occurs.) Is it the `LenovoLaptopListView` or the `Lenovo_Laptop_Details`?

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 4:52pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/5 "2023-03-13T16:52:48Z")

</div>

```auto
<div class="container">

                {% for Lenovo_Laptop_Details in Lenovo_Laptop_Detail_Specification %}
                <div class="Header_Panel">
                    <div class="Left_Header_Panel">
                        <div class="Image_Panel">
                            <div class="Thumbnail_Image_Panel">
                                <!-- <div class="Thumbnail_Image_Each_Item_Box"> -->
                                {% for images in Lenovo_Laptop_Details.images.all %}
                                <div class="Thumbnail_Image_Each_Item_Box">
                                    <img id="Thumbnail_Images" src="{{images.image.url}}" alt="" width="30px" height="45px" onmouseover="mousehover(this)">
                                </div>
                                {% endfor %}
                            </div>
                            <div class="Header_Image_Panel">
                                <section class="product-img">
                                    <img id="Laptop_Main_Image" class="image" src="{{Lenovo_Laptop_Details.image.url}}" alt="" width="280px" height="400px">
                                    <div class="magnifier-lens">
                                    </div>
                                </section>
                            </div>
                            <div class="magnified-img">
                            </div>
                            <script src="{% static 'LaptopApp/js/zoom_script.js' %}" type="text/javascript"></script>
                            <script>
                                function mousehover(thumbnail_img) {
                                    var mainImage = document.getElementById("Laptop_Main_Image");
                                    mainImage.src = thumbnail_img.src;
                                }
                            </script>
                        </div>
                    </div>
            

```

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 4:53pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/6 "2023-03-13T16:53:33Z")

</div>

This is just the sample code which I have posted here, because the website is not allowing me to post the full file.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 4:57pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/7 "2023-03-13T16:57:20Z")

</div>

HomePage =\> LaptopsPage =\> LenovoLaptops.html=\>Lenovo\_Laptop\_Details.html  
In LenovoLaptops.html it’s giving the error.  
However the point here is that .when I remove the `<a>` tag in LenovoLaptops.html, the page renders successfullly.

---

<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:** [March 13, 2023, 5:03pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/8 "2023-03-13T17:03:04Z")

</div>

> [@AnishTulsyan](#):
>
> However the point here is that .when I remove the `<a>` tag in LenovoLaptops.html, the page renders successfullly.

Good! Very good information to have. So what is that `a` tag in your template?

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:03pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/9 "2023-03-13T17:03:40Z")

</div>

```auto
  <div class="Button_Panel">
       <a href="{% url 'LaptopApp:Lenovo_Laptop_Details' Lenovo_Laptop_List.Model_Name %}" 
        {{Lenovo_Laptop_List.Model_Name}} class="button"> Details </a>
   </div>

```

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:05pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/10 "2023-03-13T17:05:13Z")

</div>

If I remove this div completely from my file, my present page Lenove\_Laptop.html renders successfully.

---

<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:** [March 13, 2023, 5:06pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/11 "2023-03-13T17:06:20Z")

</div>

> [@AnishTulsyan](#):
>
> ```auto
> <a href="{% url 'LaptopApp:Lenovo_Laptop_Details' Lenovo_Laptop_List.Model_Name %}" 
> {{Lenovo_Laptop_List.Model_Name}} class="button"> Details </a>
> 
> ```

I’ve virtually certain that you do _not_ want `{{Lenovo_Laptop_List.Model_Name}}` inside that tag.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:09pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/12 "2023-03-13T17:09:40Z")

</div>

No I need that , because this page will show me the list of all the Laptops with their Detail Specifications page.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:15pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/13 "2023-03-13T17:15:09Z")

</div>

![Digital World Store - Google Chrome 3_13_2023 10_40_19 PM](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/1/17d517cdecfc6468f8654390f1733b3c135f6921.png)

---

<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:** [March 13, 2023, 5:16pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/14 "2023-03-13T17:16:57Z")

</div>

Not **inside** that tag, no. Between the `<a>` and `</a>`, maybe.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:17pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/15 "2023-03-13T17:17:15Z")

</div>

In the above picture, as you can see, it’s showing me the list of mobile phones and with the “Details” button option.So I am going to need it .  
The strange part is that, things are working fine for the MobilesApp part, but for the LaptopApp part , it is giving problem.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:18pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/16 "2023-03-13T17:18:05Z")

</div>

yeah between the `<a>` and `</a>`

---

<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:** [March 13, 2023, 5:18pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/17 "2023-03-13T17:18:43Z")

</div>

But that’s not where you have it in the tag you posted. You have it inside the `<a>` element.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:20pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/18 "2023-03-13T17:20:57Z")

</div>

Sir, inside the ` <a>` tag,I am creating the button , so that the user can navigate to the details page of that product. there I am getting the NoReverseMatch error.

---

<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:** [March 13, 2023, 5:24pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/19 "2023-03-13T17:24:38Z")

</div>

You have:

> [@AnishTulsyan](#):
>
> ```auto
> <div class="Button_Panel">
> <a href="{% url 'LaptopApp:Lenovo_Laptop_Details' Lenovo_Laptop_List.Model_Name %}" 
> {{Lenovo_Laptop_List.Model_Name}} class="button"> Details </a>
> </div>
> 
> ```

The `{{Lenovo_Laptop_List.Model_Name}} ` is in the wrong place as identified above. You need to remove it from the inside of that `<a>` element.

---

<div class="post-metadata">

**Author:** ![AnishTulsyan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/anishtulsyan/32/12674_2.png) [@AnishTulsyan](https://forum.djangoproject.com/u/AnishTulsyan)\
**Post date:** [March 13, 2023, 5:25pm UTC](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480/20 "2023-03-13T17:25:51Z")

</div>

At what place it should be then ?

[Next page](https://forum.djangoproject.com/t/noreversematch-at-laptops-lenovolaptops/19480.md?page=2)
