News for hackers. Stuff that matters.
Re:Django Community Survey by iyn on Friday May 08, 2015 @08:29AM (#9511176)
Can you elaborate on the solutions in frontend?

Currently I'm working on a project and I want to use React "the right way". While it's not so hard to just integrate React into Django project, it's not so easy to manage the chaos when things start to grow. At the moment I'm trying to integrate React, webpack, gulp and node (server side rendering for react) into Django workflow and make it work "natural", but right now it just feels hacky and not the way I want it to work.

Would be great if you could share your workflows & ideas.

Re:Django Community Survey by simonpantzare on Friday May 08, 2015 @09:12AM (#9511446)
I put nginx in front and a location /static/ block with a try_files directive that first tries to serve static files from Django (those collected with python manage.py collectstatic) and falls back to serve files that a gulp task generated.

To serve different assets in dev and prod I let gulp generate a manifest and have a custom template tag in Django that expands to different paths depending on settings.DEBUG:

  {% my_static 'css/all.css' %}
expands to either /static/css/all.css or something like /static/css/all.min.abcd1234.css.

If nginx is serving a minified, hashed path it adds a Cache-Control: max-age=31556926 header to the response.

Re:Django Community Survey by rattray on Friday May 08, 2015 @08:57AM (#9511331)
I'm in the planning phase of porting a large C# application's frontend to React on Node (for isomorphism).

Basically we'll have our main application server (in this case, .net mvc api, but think django-rest-framework) talk to a node server as well as the client, with the same REST api. The plus is very real separation of concerns (django does all data handling, business logic; javascript does all UI). The downside is having two server stacks.

FWIW, I'm planning to use nuclear-js[1] for flux. And we're considering porting our .net code to django.

[1] https://github.com/optimizely/nuclear-js

Re:Django Community Survey by anewhnaccount on Friday May 08, 2015 @08:36AM (#9511218)
I've not done it myself (I've looked but it was a small project so I just ignored server side rendering and used django-compressor for convienience's sake) but you should definitely check https://github.com/markfinger/python-react if you haven't already
Re:Django Community Survey by Herbert2 on Friday May 08, 2015 @09:27AM (#9511558)
Simplest solution I've found is to run the devserver in a gulp task instead of using any of the pipeline/compressor projects.
Re:Django Community Survey by robertfw on Friday May 08, 2015 @12:36PM (#9512614)
My current app stack is a React+fluxxor frontend consuming a django-rest-framework driven API. The frontend/backend live in the same repo for simplicity, but are otherwise separate projects in their own subpaths that share nothing.

For deployment, I have the root path serve up the client, while the API is on its own subdomain.