M
M
mr_drinkens892016-08-14 16:09:42
Django
mr_drinkens89, 2016-08-14 16:09:42

How to access request in Django 1.10?

Good day to all.
Updated to Django 1.10 and got a problem:
there is a template tag,

@register.inclusion_tag('cart_products_counter.html', takes_context=True)
def cart_products_counter(context):
    request = context.get("request")

But, there is nothing in request. I looked at context - request is not in it either.
What is the problem?
Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2016-08-14
@mututunus

TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'django.core.context_processors.request', 
    ...
)

connected?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question