Live data from Hacker News

Django React/Redux Base Project

github.com

21–30 of 79 posts

Re: Django React/Redux Base Project

#21

They include scripts to check code quality. Perhaps those should be set up with a pre-commit git hook to ensure they get used.

Is there a way to set a pre commit git hook in a project's source code? So that the same hook only runs on that project and not on every project using git.

Typically you add files with the scripts and a Malefile or anything similar to initialize and move those files around.

So installation instructions become: 1. git clone 2. cd 3. make [init]

Re: Django React/Redux Base Project

#23
post #18

Django + React is an awesome combination that I recommend taking a look at. This repo is a good starting point but you can probably get rid of half of the dependencies if you aren't working on a team of developers. I am currently using Django + React on a personal project and took a slightly different route, no pun intended. Rather than using react router, as I never really liked client side routing, I use Django vie…

is there a better way to get server side rendering rather than a whole dependency on node for a django project?

Doesn't avoid the node dependency, but try https://github.com/airbnb/hypernova

Honestly the node dep isn't so bad. Just think of it as a template render running on another process.

Re: Django React/Redux Base Project

#24

Wish there was a project that setup Django along with create-react-app so that the webpack code could stay up to date with some kind of standard (avoiding eject if possible).

it's actually pretty annoying in my experience to use the create-react-app with django because of CORS related issues. chrome doesnt like sending ajax requests from localhost:3000 -> localhost:8000

Re: Django React/Redux Base Project

#25
post #8

So, I made a Django site with a VanillaJS single-page app framework (no React/Redux) and that includes Django server-rendered fastboot, in about 10KB Javascript code. I made it/use it for our fashion site - https://www.futureclaw.com Page load times are about .5 seconds for me, with lots of graphics. Also, I'm pretty sure it's faster than React. Is this something people want to use that I should package up into its o…

I wouldn't mind taking a look. I prefer VanillaJS. I'm currently using .Net/Java/C++ (yeah...) and am wanting to get away from that and switch to Python full time. So, I have been looking at as much Python code as I can lately.

I haven't documented/posted the JS code anywhere yet, but I did post some of the python server code on the Django developer mailing list at: https://groups.google.com/forum/#!topic/django-developers/q-...

The JS code is still being changed around.

The key here to maintain state consistency between front-end and back-end is that I transfer state from client to server via "data-model" HTML attributes. These attributes also guides the router.

Re: Django React/Redux Base Project

#27
post #17

Anyone have any success/tips using webpack with django collectstatic?

i do this, i just dump assets (uncompressed) into a build directory and use django pipeline for deployment. works fine for me.

if you want to see it in action look here:

https://github.com/josephmisiti/generic-django-project

Re: Django React/Redux Base Project

#28
post #21

Earlier quoted context omitted.

Is there a way to set a pre commit git hook in a project's source code? So that the same hook only runs on that project and not on every project using git.

Typically you add files with the scripts and a Malefile or anything similar to initialize and move those files around. So installation instructions become: 1. git clone 2. cd 3. make [init]

Note that it works best to have that install script create symbolic links for the git hooks rather than copy, so that they can be updated without having to rerun the install script.
Post reply on HN