r/django • • May 25 '20

Combining Django & React (open-source) https://knboard.com/

337 Upvotes

37 comments sorted by

View all comments

39

u/AsSimple May 25 '20

Github: https://github.com/rrebase/knboard

Here's an actual real-world example of a recommended approach when combining Django & React.

Django REST framework is used to serve the API for the React app, which is bundled into static files, served by Nginx. See the docker files & nginx.conf for the actual configuration.

2

u/nishant_wrp May 25 '20

But that disturbs the hot reload feature, right?

4

u/AsSimple May 26 '20

In development Nginx is not used. Webpack-dev-server and Django dev server run separately and hot/auto-reload perfectly.

Also since the frontend hasn't ejected from the react-scripts, we'll get the upcoming react-hot-loader change for Fast Refresh as well :)

1

u/nishant_wrp May 26 '20

Got it! Thanks!