I'm trying to prepare custom 404 and 500 error pages for a production. The 404 works fine, but I'm not able to run the 500.
In my urls.py
file:
from client_interface.views.errors.server_error_view import ServerErrorView
handler500 = ServerErrorView.as_view()
client_interface/views/errors/server_error_view.py
:
from django.shortcuts import render
from django.views import View
class ServerErrorView(View):
def get(self, request):
return render(request, "client_interface/errors/500.html")
I'm getting ?: (urls.E007) The custom handler500 view 'client_interface.views.errors.server_error_view.ServerErrorView' does not take the correct number of arguments (request).
error all the time.
I tried to change the arguments of the get
method to get(request)
but it didn't help.