How can I define the URL pattern so that I can pass to an URL as many parameters as I want? I really researched the documentation and other stackoverflow questions but I didn't found something similar to that. I need this to work as a filter for an ecommerce website.
I would like to achieve something like this:
urlpatterns = [
path('test/<str:var1>-<str:var2>/<str:var3>-<str:var4>/...', views.test, name='test'),
]
And in my view function I would define it like that:
def test(request, *args, **kwargs):
# Do whatever you want with kwargs
return HttpResponse('Test')
I think this is a wrong way to make a path, if you want to use it as a filter instead of using it in the path you should use url parameters as a get request.
But if you insist on doing that you can use the Regular expressions 're_path'