H
H
Hcuy2020-07-11 20:29:58
Django
Hcuy, 2020-07-11 20:29:58

How to avoid url looping in django?

Hello! I have a 'shop' button on my site, and a 'back' button in the shop. And if you need to go back (from the store), then this code executes.

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^list.html/$', views.product_list, name = 'product_list'),
    url(r'^list.html/index.html/$', views.index, name = 'index'),
]

but as you can understand, the url is simply summed up and does not work normally with it.
Here's an example:
' localhost:8000/list.html/index.html/list.html '
And I just can't figure out how to avoid it.
Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question