A
A
Andrey Kovalchuk2017-02-26 09:51:27
Django
Andrey Kovalchuk, 2017-02-26 09:51:27

How do you make menus in django?

Good day.
The screenshot shows the usual menu from sites, of which there are thousands. In this case, categories for news are displayed, which is below.
57c9e4ffd7.jpg
How is it customary in django to implement such a menu? From simple options I see: to transfer along with the context to each view. This approach seems wrong. Can I do it somehow through my own template tags? What approach is practiced in production?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
alex_deerk, 2017-02-26
@alex_deerk

can make a block and inheritance?

T
ThemeZV, 2017-02-26
@ThemeZ

We have made a custom tag {% show_menu %}. No difficulties arose.

P
Pan Propan, 2017-02-27
@mgis

I liked django-simple-menu , for simple projects, that's it.

M
mukhtar, 2021-01-08
@mukhtar

You can use custom template tags to implement the menu display on the site.
This article shows how this can be implemented
https://gadjimuradov.ru/post/menyu-dlya-django-sajta/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question