Answer the question
In order to leave comments, you need to log in
Why is the variable set with the process_request middleware not showing up in a django template?
from django.core.urlresolvers import resolve
class MyCustomMiddleware(object):
# пробовал так
def process_request(self, request):
request.testvar = 'testval'
# пробовал и так
def process_view(self, request, view_func, view_args, view_kwargs):
request.testvar = 'testval'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question