Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

437
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!