urls.py
url(r'^(?i)(?P<slug>[a-zA-Z0-9_]+)$', views_search.index, name='articles'),
context_processor.py
def get_username(request, **kwargs):
print kwargs
slug = kwargs.get('slug')
return {
'slug': slug
}
But when I run it, it prints an empty dict and returns nothing to the template. I added this to the template context processors in the setup. How can I access kwargs here?
source
share