Django-React with webpack or create-react-app

39 views
Skip to first unread message

Alaydyn Gholechragh

unread,
Mar 7, 2020, 4:22:09 AM3/7/20
to Django users
hi 
I want to use Django and react together but there is one problem , I don't know it is good I make react application with  "webpack and bundler "  or  "creat-react-app "??

which is better ???

Ronit Mishra

unread,
Mar 7, 2020, 4:37:44 AM3/7/20
to django...@googlegroups.com
Start with `creat-react-app`.. webpack and bundler are task runners that bundle your code for production. `creat-react-app` has a bundler program inbuilt. Once you're comfortable with React and you're easily able to communicate between Django and React components, then you might wanna look into improvising your production build for your react code. You should explore external bundlers for your React application after that. 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e813b99f-1ec4-456a-8110-09be009ff4d3%40googlegroups.com.

Alaydyn Gholechragh

unread,
Mar 7, 2020, 4:59:35 AM3/7/20
to Django users
thanks for answer  but I think to build react from  'create-app-react' create a folder with name  'build' and I can't change it and config is hard for work them together    


On Saturday, March 7, 2020 at 1:07:44 PM UTC+3:30, Ronit Mishra wrote:
Start with `creat-react-app`.. webpack and bundler are task runners that bundle your code for production. `creat-react-app` has a bundler program inbuilt. Once you're comfortable with React and you're easily able to communicate between Django and React components, then you might wanna look into improvising your production build for your react code. You should explore external bundlers for your React application after that. 

On Sat, Mar 7, 2020 at 2:52 PM Alaydyn Gholechragh <ala...@gmail.com> wrote:
hi 
I want to use Django and react together but there is one problem , I don't know it is good I make react application with  "webpack and bundler "  or  "creat-react-app "??

which is better ???

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

Ronit Mishra

unread,
Mar 7, 2020, 5:43:06 AM3/7/20
to django...@googlegroups.com
You don't have to create a folder named 'build', `create-react-app` provides you with a separate source and build directory. Once you've your code ready, you just need to run `npm run build` and your source code would be translated into a production-ready code in the build directory. 

You can easily update any default scripts that `create-react-app` provides, such as start, test or build to override the default behavior.

Honestly, just dive into the documents and start getting your hands dirty with coding.

And If you're an advanced developer who understands working with production build, then it won't be a challenging task for you to later explore more configurations or packaging options for your React application. 

To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/993da381-f9ce-4e70-a1f8-209be6585329%40googlegroups.com.

Dan Davis

unread,
Mar 9, 2020, 4:16:18 PM3/9/20
to Django users
If you wish to use cache busting, or create-react-app sets that up by default, you can configure some special logic for loading the bundles.
Mine is per-process based, and assumes that since the bundle will be cached, it reasonable not to create a new static file loader:

Reply all
Reply to author
Forward
0 new messages