Hi im new to coding and django and im trying to create a simple e-commerce website but when clicking a button to redirect to cart but it is not going through. this error comes up when i initiate the server.
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python38\lib\sre_parse.py", line 831, in _parse
raise source.error(err.msg, len(name) + 1) from None
re.error: redefinition of group name 'id' as group 2; was group 1 at position 25
here is the html code
<!-- Product Pricing -->
<div class="product-price">
<span>{{i.product_price}}</span>
<a href="/cart/{{i.id}}/{{customer.id}}" class="cart-btn">Add to cart</a>
<p>{{customer.id}}</p>
<a href="" class="cart-btn">go to cart</a>
</div>
my views code
def cart(request,cid,pid) :
p_info=product_info.objects.get(id=pid)
c_info=login_details.objects.get(id=cid)
return render(request, 'customer side/cart.html')
my appurl code
urlpatterns=[
path('register',views.save_login_info),
path('cart/<int:id>/<int:id>/',views.cart),
path('login',views.logging_in,name='login'),
path('list',views.product_catalogue),
path('new',views.add_product),
path('savingdata',views.addnew,name='saving'),
enter code here
]
``
the error apppears to have something to do with the url part of the cart when i remove on of the integer id from cart/int(id)/int(id) the error disappears but i need both numbers.
i tried assigning values to the variables in my views code but nothing seems to fix the problem.
please help.