Some notes on starting to use Django
31–40 of 145 posts
Re: Some notes on starting to use Django
#32Claude Code is also very good at building basic CRUD apps with Django.
No kidding, it is really good especially with htmx which helps you get some of the advantages of a full SPA without the complexity of a separate frontend. Been building a project in the side to help my studies and it usually implement new complete apps from one prompt, working on the first try
Re: Some notes on starting to use Django
#33After spending a lot of my time on Django, it's fine for simple to moderately complex things. The ORM mostly good. DRF is fine for APIs. And the admin is super nice as well. But once something gets significantly complex, the ORM starts to fall down, and DRF becomes more of a hindrance. But if you're just doing simple CRUD apps, Django is perfectly serviceable.
Re: Some notes on starting to use Django
#34I much prefer Python but am not really seeing any point to doing anything other than JavaScript for web projects at this point. I also do not see much reason to do more than emit JSON on the server side.
Well... that's a valid reason. Why should I work with tool B when I prefer tool A ?
> I also do not see much reason to do more than emit JSON on the server side.
That's the "SPA over API" mindset we need to reconsider. A lot (and I mean A LOT) of projects are way easier to produce and maintain with server-side rendered views.
Re: Some notes on starting to use Django
#35Earlier quoted context omitted.
Its crazy to me after all these years that django-like migrations aren't in every language. On the one hand they seem so straightforward and powerful, but there must be some underlying complexities of having it autogenerate migrations. Its always a surprise when i went to Elixir or Rust and the migration story was more complicated and manual compared to just changing a model, generating a migration and committing. In…
There is no way to autogenerate migrations that work in all cases. There are lots of things out there that can generate migrations that work for most simple cases.
Re: Some notes on starting to use Django
#36After spending a lot of my time on Django, it's fine for simple to moderately complex things. The ORM mostly good. DRF is fine for APIs. And the admin is super nice as well. But once something gets significantly complex, the ORM starts to fall down, and DRF becomes more of a hindrance. But if you're just doing simple CRUD apps, Django is perfectly serviceable.
Re: Some notes on starting to use Django
#37The Django ORM / migrations are still basically unmatched in happiness factor.
Its crazy to me after all these years that django-like migrations aren't in every language. On the one hand they seem so straightforward and powerful, but there must be some underlying complexities of having it autogenerate migrations. Its always a surprise when i went to Elixir or Rust and the migration story was more complicated and manual compared to just changing a model, generating a migration and committing. In…
Re: Some notes on starting to use Django
#38> I love being able to backup by just doing a VACUUM INTO and then copying the resulting single file. Naively, I would probably just copy the sqlite file. Is that a bad idea?
That's fine if SQLite isn't running, but you risk corruption if you copy a file while it is being actively written to. VACUUM INTO eliminates that risk.
Re: Some notes on starting to use Django
#39The Django ORM / migrations are still basically unmatched in happiness factor.
Re: Some notes on starting to use Django
#40The Django ORM / migrations are still basically unmatched in happiness factor.
oh the automatic migrations scare the bejesus out of me. i really prefer writing out schemas and migrations like in elixir/ecto. plus i like the option of having two different schemas for the same table (even if i never use it)
You can run raw SQL in a Django migration. You can even substitute your SQL for otherwise autogenerated operations using `SeparateDatabaseAndState`.
You have a ton of control while not having to deal with boilerplate. Things usually can just happen automatically, and it's easy to find out and intervene when they can't.
https://docs.djangoproject.com/en/6.0/ref/django-admin/#djan...
https://docs.djangoproject.com/en/6.0/ref/migration-operatio...