sec53
sec53

Reputation: 1

How can I pass a variable to all of my views? (Django)

I need to use the same object in all of my views. Is there a better way to get it in the template than repeating myself in each view. e.g., I need to get Myobj.objects.all() for all of my views.

Thanks

Upvotes: 0

Views: 154

Answers (1)

girasquid
girasquid

Reputation: 15506

Sounds like context processors are what you're looking for here.

Upvotes: 5

Related Questions