Ulianka Shu
Ulianka Shu

Reputation: 131

How to setup Django + React on hosting?

I've done Django + React application. I build React code using 'npm run build' and moves that files to hosting together with Python files, I've set up static files in Django app, and now when I'm going to site URL, I see that all static files are loaded. But they don't run. And when on the local environment I saw pretty JS app, now on hosting I see a white screen and when I select compiled JS files in Network tab in Developers Tools (Preview response) I read message "You need to enable JavaScript to run this app." (for CSS too).

I know that this is a noob question. But can you help me to solve this issue?

Thank you.

Upvotes: 0

Views: 2259

Answers (1)

Justin Formentin
Justin Formentin

Reputation: 294

Check this site out https://www.techiediaries.com/create-react-app-django/

And go down "Integrating React App with Django in production"

This will show you how your app should be structured with the correct settings in your django files.

Upvotes: 3

Related Questions