Live data from Hacker News

Some notes on starting to use Django

jvns.ca

11–20 of 145 posts

Re: Some notes on starting to use Django

#11
post #10

The 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 the pre-LLM world, I was writing ecto files, and it was super repetitive to define make large database strucutres compared to Django.

Re: Some notes on starting to use Django

#12
post #10

The 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)

Re: Some notes on starting to use Django

#13
post #10

The 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…

well in elixir you can have two schemas for the same table, which could represent different views, for example, an admin view and a user view. this is not (necessarily) for security but it reduces the number of columns fetched in the query to only what you need for the purpose.

Re: Some notes on starting to use Django

#14
post #10

The 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)

I have never done it, but I believe you could setup multiple schemas under the same database -by faking it as different databases and then use a custom router to flip between them as you like.

That sounds like the path to madness, but I do believe it would work out of the box.

Re: Some notes on starting to use Django

#15

Earlier quoted context omitted.

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)

I have never done it, but I believe you could setup multiple schemas under the same database -by faking it as different databases and then use a custom router to flip between them as you like. That sounds like the path to madness, but I do believe it would work out of the box.

sounds inconvenient and error-prone

Re: Some notes on starting to use Django

#16
post #3

Thanks for this! I wish there were more cross-comparisons like this out there of what it is actually like to use some of these frameworks, the note on Django being a little less magic than Rails makes me genuinely interested in it.

if you want "less magic than rails" check out ecto, i would say it has less magic than django

Re: Some notes on starting to use Django

#17

Django aside, I think this is a really important point: Being able to abandon a project for months or years and then come back to it is really important to me (that’s how all my projects work!) ... It's perhaps especially true for a hobbyist situation, but even in a bigger environment, there is a cost to keeping people on hand who understand how XYZ works, getting new people up to speed, etc. I, too, have found found…

This is the main reason I'm extremely disciplined about making sure all of my personal projects have automated tests (configure to run in CI) and decent documentation.

It makes it so much easier to pick them up again in the future when enough time has passed that I've forgotten almost everything about them.

Re: Some notes on starting to use Django

#18

> 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

#19
post #2

Claude 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

#20
post #10

The 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…

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.
Post reply on HN