On Mon, Dec 11, 2017 at 10:23 PM, Chris Seberino <[email protected]>
wrote:

> 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'"
>

It means literally that "handle_404() got an unexpected keyword argument
'exception'", how are you calling handle_404()?


>
> (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 [email protected].
> To post to this group, send email to [email protected].
> 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
> <https://groups.google.com/d/msgid/django-users/c87198a3-327c-4dbf-a6d0-114a800fa560%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CA%2BFDnhJ9ZLjPb5vavucHxsOyKPpYVbukHtwjc6fgmA24F1EQMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to