A
A
Andrey Salnikov2017-10-20 08:18:34
Django
Andrey Salnikov, 2017-10-20 08:18:34

How to properly enable mptt_url?

The site uses MPTT.
Example from urls.py

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^(?P<path>.*)',
        mptt_urls.view(model=Page, view=views.page_view, slug_field='slug'),
        {}, name='page'),
]

It was written to do so in the docks to mptt_url, but if I go to the address - admin - then I get a 404 error. And if - admin/ - then everything is in order. And so with each page, if you write without a slash, then 404. And if everything is in order. APPEND_SLASH = True in settings. How to fix this error?

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