Answer the question
In order to leave comments, you need to log in
Regex url django. How to make multiple slugs clean url?
I need url by type
/catalog/catalog_slug/tag_slug1/tag_slug2/tag_slug3
to filter catalog items by tagsre_path(r'^catalog/(?P<catalog_slug>\w+)/(?P<tag_slugs>(?:\w+/)+)', ...)
TypeError: get() got multiple values for argument 'catalog_slug'
class CategorySeoTagsView(APIView):
def get(self, catalog_slug, tag_slugs):
pass
Answer the question
In order to leave comments, you need to log in
See get_absolute_url in the model and subdirectories.
class Category
...
def get_absolute_url(self):
return reverse(
'catalog:product_list_by_category',
kwargs={'category_slug': self.slug}
)
class Product
...
def get_absolute_url(self):
return reverse(
'catalog:product_detail',
kwargs={
'product_slug': self.slug,
'category_slug': self.category.slug
}
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question