2 ms·
That's a nice idea for new projects but how would you handle a company with large existing Django sites that want to bring in one or two react-based SPAs?
by bredren 6y ago
That's a nice idea for new projects but how would you handle a company with large existing Django sites that want to bring in one or two react-based SPAs?
- deleted 6y ago[deleted]
- nickserv 6y agoWe did this with Vue.js, not sure if it applies to React (I haven't used React). The way we did it was to start with a few parts of the page that really benefited from having Vue.js, using a simple `script src=`. So no components or anything fancy. For this we just put the JS stuff using Django's template system. Once we had proved that this improved the site, we went all in and started to use the "proper" way, building the JS and deploying to a CDN. In parallel to this we set up Django Rest Framework and set up alternate routes to fetch the view data as JSON. In retrospect I would probably skip the hybrid system and just start building view components, but it was done this way so we could more easily revert if it didn't work out.