4 ms·
I'm interested in building a site in the same way (Django + Intercooler + VanillaJS). Do you have any recommended projects/readings to look into? Or do you have
by raihansaputra 6y ago
I'm interested in building a site in the same way (Django + Intercooler + VanillaJS). Do you have any recommended projects/readings to look into? Or do you have any thoughts on other alternatives (StimulusJS + Turbolinks / Unpoly)?
- mishu2 6y agoHey, I think Django has some of the best documentation of any project I know (both reference and tutorials/guides): https://docs.djangoproject.com/en/3.0/ https://docs.djangoproject.com/en/3.0/ There is some material on using Django with intercooler.js: https://www.reddit.com/r/django/comments/5nj242/psa_intercoolerjs_is_a_delightfully_simple_js/ https://www.reddit.com/r/django/comments/5nj242/psa_intercoo... https://engineering.instawork.com/iterating-with-simplicity-evolving-a-django-app-with-intercooler-js-8ed8e69d8a52 https://engineering.instawork.com/iterating-with-simplicity-... but in the end I did something slightly different: for actions I just have in my views: if 'X-Ic-Request' not in request.headers: # render full page (which includes the fragment template) else: # render fragment template (which Intercooler will interpolate into the page) That way, should I get to that page by any other way (user has disabled JS, I have a link in my page because I want a full page reload), it still works fine. Hope this helps. I had a look at Unpoly, that looks very interesting and could simplify the backend code even more.
- raihansaputra 6y agoYeah, Django's documentation is top notch, but I haven't seen a lot about mixing Django + Intercooler. That's a cool approach to make sure the actions are always reachable. Will read these, and maybe reach out to you sometime to find out how you like Unpoly! Thanks!