I wrote custom django error templates and do not need any other custom behavior than a custom path to the template (Templates are not located at root directory). I tried the following:
handler400 = partial(bad_request, template_name='polls/errors/400.html')
handler403 = partial(permission_denied, template_name='polls/errors/403.html')
handler404 = partial(page_not_found, template_name='polls/errors/404.html')
handler500 = partial(server_error, template_name='polls/errors/500.html')
But it seems that I need to pass the views as a string. Do I have to write custom views which do exactly the same or how can the template name be changed?
The solution was to put the code in the root url configuration.