Live data from Hacker News

Django React/Redux Base Project

github.com

11–20 of 79 posts

Re: Django React/Redux Base Project

#11
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.

Re: Django React/Redux Base Project

#12
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…

It's always interesting to see how someone elses tackles something. Personally I'd probably have used Pjax or intercooler.js for that. I assume the ajax-ey part is simply to avoid full page reloads and improve the general speed? Other than that it's fairly static content?

(would be interesting to compare the performance of this vs static site generator output on a really fast CDN - my hunch would be that this would probably win unless you were at a geographic disadvantage)

Re: Django React/Redux Base Project

#13
So for people who think they need Redux, first read "You Might Not Need Redux" [0] by Dan Abramov himself, creator of Redux.

Then also I would recommend MobX [1] over Redux, it's easier to get started and in my opinion easier and better in general.

[0] https://medium.com/@dan_abramov/you-might-not-need-redux-be4...

[1] https://github.com/mobxjs/mobx

Re: Django React/Redux Base Project

#14

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.

Re: Django React/Redux Base Project

#15
post #5

This looks a lot more sophisticated than my starter pack for the same stack, though it would be a good idea to add a Dockerfile. [0] [0] https://github.com/gigster-eng/python-starter

hey, I'm one of the developers of this repo. We actually use docker in some of our projects but we never had time to add it to this project. Feel free to send us a PR :)

Re: Django React/Redux Base Project

#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?

Re: Django React/Redux Base Project

#19
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?

If your project is small enough you can scrape it and generate all pages. You need a server only in development but then you can host it statically (and for free, e.g. on github).

Check out hasgluten.com for an example, code here (pretty old version of react though): https://github.com/hasgluten/hasgluten

Re: Django React/Redux Base Project

#20
post #12
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…

It's always interesting to see how someone elses tackles something. Personally I'd probably have used Pjax or intercooler.js for that. I assume the ajax-ey part is simply to avoid full page reloads and improve the general speed? Other than that it's fairly static content? (would be interesting to compare the performance of this vs static site generator output on a really fast CDN - my hunch would be that this would p…

It's static content (for now... the site is being designed for user-generated content.), but page generation times without caching is about 1-2ms (3-7ms with gzip), and I'm actually speeding that further with materialized database views, probably down to 500us. With Redis caching it's in the 350us range. Those are latency numbers. So, it's about as fast as it gets.

Note that I don't use the Django Templating system at all, and generate pages in Python instead.

I already went through a viral moment that caused our site to go down for a day after our last issue (we're a print magazine), and so the site is being designed to work around that.

Post reply on HN