I'm trying to get a 404 page to show instead of a 500 error when Django app sees a nonexistent URL.
I'm still getting 500 errors with this clue in logs but I don't know what it means.... Please explain "TypeError: handle_404() got an unexpected keyword argument 'exception'" (The nonexistent URL I tried was /aaa.) Internal Server Error: /aaa Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 35, in inner response = get_response(request) File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 113, in _get_response resolver_match = resolver.resolve(request.path_info) File "/usr/local/lib/python3.5/dist-packages/django/urls/resolvers.py", line 523, in resolve raise Resolver404({'tried': tried, 'path': new_path}) django.urls.exceptions.Resolver404: {'path': 'aaa', 'tried': [[<URLPattern '^$'>], [<URLPattern '^main/handle_404/$'>], [<URLPattern '^main/main/$'>], [<URLPattern '^explorer/search/$'>]]} During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 99, in get_exception_response response = callback(request, **dict(param_dict, exception=exception)) TypeError: handle_404() got an unexpected keyword argument 'exception' -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c87198a3-327c-4dbf-a6d0-114a800fa560%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.