How to pass data to any template without passing data from the views to template in django

preview_player
Показать описание
How to pass data to any template without passing data from the views to template in django | global model(database) data for every template

pass data to any template without passing it through the views in Django

1- Create context_processors file in app folder

2- Import Model & return it in form of dictionary via a function.

4-Use this database or model data in any templates

Рекомендации по теме
Комментарии
Автор

Thanks Soo much, this video has really help me after hours of struggles. thanks once more

yakubuabdullahi
Автор

where is the data came from

how to add data to it??

adnank
visit shbcf.ru