Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

435
Vistas
Deployment of a React app with Django backend

As in the title I use React.js at the frontend and Django at the backend. I basically remade a website for my father's enterprise and we got cPanel on our hosting service (prevoius website was made in Django alone). The problem is I use cross origin in the new app. It is easy for me to just open up 2 command prompts and start 2 different localhosts for Django and React, but I have no idea how to do it on the server side.

I had some ideas before like: "Should I buy a second server and host just React there?" or "Should I somehow merge backend and frontend together?", but still I have no idea which solution would fit the most.

I would be grateful for any advice, tutorials, links that would help me solve this problem. If needed I can paste a github link to a project aswell.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to set the Access-Control-Allow-Origin header in your server config:

The Access-Control-Allow-Origin header specifies which URLs are allowed to be accessed by JavaScript:

For example:

Access-Control-Allow-Origin: http://www.example.com

would allow your App to access www.example.com

Apache: https://enable-cors.org/server_apache.html

nginx: https://enable-cors.org/server_nginx.html

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda