Alireza Atashnejad
Alireza Atashnejad

Reputation: 631

how to Run Django and React server together?

I wanna know is it possible Running two server Django and React.js together? every time I should to run Backend with python manage.py run server and then I should go to Frontend and Run npm Start

actually I have One Fullstack project with Subfolders Backend And Frontend

my question is we have any code to rune both servers together or Not?

Upvotes: 0

Views: 1348

Answers (2)

varijkapil13
varijkapil13

Reputation: 409

You can create a bash script that goes to each of your folder and runs those commands for you.

Something along the lines of:

cd /backend
python -d manage.py runserver

cd ../frontend
npm run start

Assuming your project resides in app/backend and app/frontend. Put this script in app as start_servers.sh for example. And run this like bash start_servers.sh

Note: This script probably won't run, because the -d flag to run the server in detached mode probably won't work. And I have not tested it. It maybe something you don't want. This script only demonstrates that it is possible, but it will need some tinkering.

Upvotes: 1

Mehi
Mehi

Reputation: 59

As I know,unfortunately,there is no way to run them both with just a line of code.This can be wrong though.

Upvotes: 1

Related Questions