开发者

django template extends base but base has variables to show

开发者 https://www.devze.com 2023-01-26 21:41 出处:网络
I have some templates set up for my app, which extend a base template but the base template has variables in it (a list of items in the footer). Currently I am getting these variables in the views.py

I have some templates set up for my app, which extend a base template but the base template has variables in it (a list of items in the footer). Currently I am getting these variables in the views.py method for my app by importing the footerApp and then getting the items and passing them to the context to render out with the variables for this app. Surly that can;t be right. Is there a way to automatically call 开发者_Python百科methods that a view needs when it's template is called?


Nevermind! I found this template.

0

精彩评论

暂无评论...
验证码 换一张
取 消