[Answered ]-Django view didn't return an HttpResponse object

2👍

return f(request, *args, **kwargs) calls the view function in the wrapper of the decorator. However, the branch for ajax requests only does a print and leaves the function without a return statement that returns a valid response object:

if request.is_ajax():
    print('ajax request') 
    ... # return a response object here to avoid returning None

Leave a comment