Problem cors Issue in a request XMLHttpRequest

I want to solve the problem when I request a request in pythoanywhere the request requests path an addition to the domain and path

I just want to add the domain only, without the path, how is that?
Please note that I use cors in Django(django-cors-headers)

export function backendLookup(method, endpoint, callback, data) {
  let jsonData;
  if (data) {
    jsonData = JSON.stringify(data);
  const xhr = new XMLHttpRequest();

  const url = `api${endpoint}`;
  xhr.responseType = "json";
  const csrftoken = getCookie("csrftoken");, url);
  xhr.setRequestHeader("Content-Type", "application/json");

  if (csrftoken) {
    // xhr.setRequestHeader("HTTP_X_REQUESTED_WITH", "XMLHttpRequest")
    xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    xhr.setRequestHeader("X-CSRFToken", csrftoken);

  xhr.onload = function () {
    if (xhr.status === 403) {
      const detail = xhr.response.detail;
      if (detail === "Authentication credentials were not provided.") {
        if (window.location.href.indexOf("login") === -1) {
          window.location.href = "/login?showLoginRequired=true";
    callback(xhr.response, xhr.status);
  xhr.onerror = function (e) {
        message: "The request was an error",

Meaning when I enter the link in the browser:

The api backendLookup Automatically converts the domain and path:

And I just want to add only the domain, how is that: