D
D
Daniil Chernov2021-11-01 13:09:57
Django
Daniil Chernov, 2021-11-01 13:09:57

How to display model in any template?

There is a configuration model:

spoiler
class Settings(models.Model):
name = models.CharField(max_length=200, verbose_name='Название')
value = models.TextField(verbose_name='значение')


Let's say I want to place one of the records of this model in my main template.
How to make records of this model available without setting them in views?

I look towards the intermediate layer, but have not yet fully figured it out.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-11-01
@dancha

https://docs.djangoproject.com/en/3.2/ref/template...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question