Hello,
The project I'm working on has it's custom template context_processor.
And when unavailable URL request arrives to Django (Eg. "/wp-login.php"), the context_processor is throwing AttributeError.
Which way should I use to prevent from context processor from throwing errors?
Is it ok to wrapping return with try block and returning empty dictionary if AttributeError raised?
def resolver_context_processor(request):
return {
'app_name': request.resolver_match.app_name,
'namespace': request.resolver_match.namespace,
'url_name': request.resolver_match.url_name
}