I'm trying to redirect a Django View function to a page in PHP, currently hosted on my own computer.
The fact is that I've seen that it gives me a crossover error because I'm calling another link from my own team.
I have found a module called django-cors-headers and I have configured it as it comes in the documentation link
MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
]
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_CREDENTIALS = False
After the end of the function I pass the url but I still get the same error
return HttpResponseRedirect('http://localhost/pruebas/prueba.php',{'datos':datos})
and this is the answer:
Solicitud desde otro origen bloqueada: la política de mismo origen
impide leer el recurso remoto en http://localhost/pruebas/prueba.php
(razón: falta la cabecera CORS 'Access-Control-Allow-Origin').