Live data from Hacker News

Django React Redux JWT Base Project

github.com

11–20 of 28 posts

Re: Django React Redux JWT Base Project

#11
post #9

Earlier quoted context omitted.

Silly question, but can't you run Django to serve your backend API, and Webpack to serve your static assets including javascript, then use an http proxy like Nginx to serve them under the same url?

well for development that's a good idea. For production you don't want to have webpack serving anything, you want it compiled, right?

That's what I do. Webpack compiles to the static/ dir and Django serves the static files in that dir. I don't know how/why you would do it otherwise.

Re: Django React Redux JWT Base Project

#12
Not sure why the `accounts` app is included [0]. As seen from the comments [1] in the `models.py` it looks like it's from an existing project, don't think this should be in a boilerplate project.

Nevertheless, nice boilerplate project :).

[0] https://github.com/Seedstars/django-react-redux-jwt-base/tre...

[1] https://github.com/Seedstars/django-react-redux-jwt-base/blo...

Re: Django React Redux JWT Base Project

#14
post #9

Earlier quoted context omitted.

well for development that's a good idea. For production you don't want to have webpack serving anything, you want it compiled, right?

That's what I do. Webpack compiles to the static/ dir and Django serves the static files in that dir. I don't know how/why you would do it otherwise.

For fast development iterations, running webpack's own web server is used for development.

Where django would instead load a custom JS endpoint in development, and use the compiled file for production.

Webpack static compile each time is just way to slow— I've seen it take 60+seconds to compile.

Re: Django React Redux JWT Base Project

#15

Not sure why the `accounts` app is included [0]. As seen from the comments [1] in the `models.py` it looks like it's from an existing project, don't think this should be in a boilerplate project. Nevertheless, nice boilerplate project :). [0] https://github.com/Seedstars/django-react-redux-jwt-base/tre... [1] https://github.com/Seedstars/django-react-redux-jwt-base/blo...

You're right. I copy pasted some code from some projects to build this generic one. A colleague will fix it in a few minutes :)

Re: Django React Redux JWT Base Project

#18
Great work, I've been enjoying using this exact stack recently - this has definitely taught me a few things.

The main thing I'm still trying to get my head round with React/Redux/Router is where in the lifecycle to do data fetching - I noticed you're doing it in componentWillMount, when the React docs suggest componentDidMount, and I've seen others do it in various other ways with no clear indication what the 'best practice' approach is.

Re: Django React Redux JWT Base Project

#20

Great work, I've been enjoying using this exact stack recently - this has definitely taught me a few things. The main thing I'm still trying to get my head round with React/Redux/Router is where in the lifecycle to do data fetching - I noticed you're doing it in componentWillMount, when the React docs suggest componentDidMount, and I've seen others do it in various other ways with no clear indication what the 'best p…

I understand your thoughts and normally we follow the React docs suggestions for generic components. We place data fetching code in componentWillMount in those cases we want to win some time, but if it's not the case I would recommend to place it in componentDidMount as React docs suggests.
Post reply on HN