Vitalii Ponomar
Vitalii Ponomar

Reputation: 10946

Django: how to define a global property for request?

There are some global properties in request in every view (for example request.user).

I want to define my own global property for request. How to do that and in what place?

Thanks!

Upvotes: 1

Views: 218

Answers (1)

keni
keni

Reputation: 1768

You need to write a custom context processor. Check the djangodocs for info or see a sample http://bradmontgomery.blogspot.com/2009/01/add-context-processor-for-your-django.html .

Upvotes: 3

Related Questions