[Fixed]-Send url to ajax's success () from Django backend

1👍

In your processing view:

from django.http.response import JsonResponse
def whatever_your_view_name_is(request):
    (data processing...)
    return JsonResponse({'url': the_url_to_page_2)

then in your JS:

        (...)
        success: function (response) {
            window.location.href = response.url;
        },
        (...)

Leave a comment