Answer the question
In order to leave comments, you need to log in
How to properly implement routing in Django?
The site has many pages like /<something 1>/<something 2>. The problem is that these "something 1" and "something 2" are in the database, but they can be completely different tables. For example:
/москва/ремонт-авто
/опель/колеса
url(r'^(?P<city_slug>.*)/(?P<service_slug>.*)/$', ServiceView.as_view(), name='service'),
url(r'^(?P<model_slug>.*)/(?P<part_slug>.*)/$', PartView.as_view(), name='part'),
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question