django - Fetch data from DB on every pageload -


i need make db query on every view within app, in order pass data templates. since views not classes, simple functions, can't have construct, can query.

so, structurally speaking, best practice on put kind of logic? create template tag , queries there, seems not organized me.

firstly, views can classes: django has offered class based views since version 1.3.

however, best way pass data every template use context processor.


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -