A
A
Alexander2018-10-01 13:58:02
Django
Alexander, 2018-10-01 13:58:02

How to bind url pattern in Django to model?

There is a blog.
The blog has info pages (domain.rf/url-pages) and section pages (domain.rf/url-section)
Can I somehow determine which view to work with in urls.py?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-10-01
@cashncarry

urls.py just to determine which view to work with

urlpatterns = [
    url(r'^урл-раздела/$', SectionView.as_view()),
    url(r'^урл-страницы/$', PageView.as_view()),
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question