davidkell
Joined 9 years ago
Joined 9 years ago
Lack of a decent Rails/Django option for JS/TS is part of the issue IMO, since that ecosystem is so popular atm.
I also wonder if you have to get burned a few times rolling your own and that's just part of the journey :)
- Start with SaaS Pegasus https://www.saaspegasus.com/
- Deploy to Heroku
- Get comfortable with "X-in-HTML" frameworks - Tailwind, HTMX, Alpine
- Deliver your mobile app as a PWA https://web.dev/what-are-pwas/
Opinionated thoughts -> https://davidkell.substack.com/p/davids-opinionated-guide-fo...(Nowadays I'd replace Turbo/Stimulus -> HTMX/Alpine)
Special thanks to Cory for his excellent guides on Django + JS: https://www.saaspegasus.com/guides/
- Cory’s writing on low JS alternatives to single page web apps was game changing for us. And that’s all built in. 10x faster to develop.
- You get access to a wonderful community of Django devs. Any question gets 3+ independent responses.
- The framework is non-opinionated. You get the same examples in both HTMX and React + APIs, many versions of CSS frameworks (Bulma, Tailwind, Bootstrap), multiple deployment methods, etc. This gives you a valuable toolkit to fit your solution around the needs of the problem.
We re-built our SaaS product using this boilerplate and wrote about the experience [1]. TL;DR: would recommend!
[0] https://www.saaspegasus.com/guides/modern-javascript-for-dja...
[1] https://davidkell.substack.com/p/davids-opinionated-guide-fo...
To be honest, I was surprised that you advocated writing so many tests for each view, easily 10-20 per view.
Part of the beauty of Django's various class based interfaces is that you can be confident that if you add a validator to a model field, then it will be validated by the corresponding ModelForm in the corresponding CreateView.
But then again, you advocate against OOP in python including CBVs. If you do write all your endpoints as functions, it makes more sense you need to test it because it's easy to forget to include a line of validation or whatever it is.
FWIW I love the fact that various Django classes are like DSLs. DSLs are less powerful by construction, so less buggy. It is almost like using low-code. But I do see your point about tracking inheritance and control flow, it can be a challenge at scale.
We've previously tried React+Hasura/Postgraphile and React+DRF/GraphQL, but this is next level productive and a joy to use, and bugs are rare. Particular love for Django CBVs.
@Alex3917 What do you think of using Django-rendered templates for views that don't require significant frontend interactivity?
You seem to advocate the "everything is an SPA + Rest API" approach, which I thought was interesting.