I am running Django 1.9.6
If I try to use {{ request.path }}
in my templates the var/tag is empty
Here is my settings.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os.path.join(BASE_DIR, '_templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.i18n',
],
'builtins': ['django.templatetags.i18n']
},
},
]
I read that after version 1.8 you need only to include 'django.template.context_processors.request'
and you will have the var running in your templates
I manage to fix the issue if in my VIEW i add
return render_to_response('admin-users/events.html', {}, context_instance=RequestContext(request))
What am I doing wrong, because I read many answers which say that I don't have to add RequestContext
?