title: react conversion using django redirect
body: <p>I have two react projects (localhost:3000, localhost:3001) and a Django server (localhost:8000) running in my local environment.
  I want to use the API that calls port 3001 using the function below in react 3000 port as django's redirect function.</p>
  <p>localhost:3000 button function redirect calling localhost:3001 in ReactAPP</p>
  <pre class="lang-js prettyprint-override"><code>const getProject = () =&gt;{
      console.log('go localhost:3001')
      axios.post('http://localhost:8000/user/Dashboard')
      .then(res =&gt; {
        setauth(true)   
      })
    }
  </code></pre>
  <p>View from &quot;http://localhost:8000/user/Dashboard&quot; in django</p>
  <pre class="lang-py prettyprint-override"><code>def getDashBoard(request):
      
      return redirect('http://localhost:3001')
   
  </code></pre>
  <p>settings.py</p>
  <pre class="lang-py prettyprint-override"><code>ALLOWED_HOSTS = ['localhost','127.0.0.1']
  CORS_ALLOWED_ORIGINS = [&quot;http://localhost:8000&quot;
                          &quot;http://localhost:3001&quot;,
                          &quot;http://localhost:3000&quot;,
                          &quot;http://127.0.0.1:3000&quot;,
                          &quot;http://'127.30.1.47':3000&quot;]
  
  CORS_ORIGIN_WHITELIST = ['localhost']
  CORS_ORIGIN_ALLOW_ALL = True
  CORS_ALLOW_CREDENTIALS = True
  
  CSRF_COOKIE_SAMESITE = 'None'
  SESSION_COOKIE_SAMESITE = 'None'
  </code></pre>
  <p>The withCredentials option is essential because I want to proceed with the project using Cookie's Token in the future.</p>
  <p>But</p>
  <p>The following error appears.</p>
  <pre><code>Access to XMLHttpRequest at 'http://localhost:3001/' (redirected from 
  'http://localhost:8000/user/Dashboard') from origin 'http://localhost:8000' has been
   blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the 
  response must not be the wildcard '*' when the request's credentials mode is 'include'
  . The credentials mode of requests initiated by the XMLHttpRequest is controlled by the 
  withCredentials attribute.
  </code></pre>
  <p>I want to change 'Access-Control-Allow-Origin' when calling 3001 in ReactAPP, but I can't think of a way.</p>
  <p>Please help if I am trying the wrong way.</p>