Live data from Hacker News

Django 4.0

djangoproject.com

61–70 of 226 posts

Re: Django 4.0

#61
post #3

I must learn Django, it's got everything I'll ever need. No, Rails will make me happy and it's better for lonely devs like me. No I must learn a Modern Web Framework (TM) to prove I'm not stuck in the past. No way, I'm not a fashionista. Have you seen that Phoenix demo where the guy builds Twitter in like 4 minutes? That's the future. Hold on a minute, enough of this magic. I need to learn to build everything in Comm…

There are just so many makes and models of automobile and people get by. I remain so confused why choice paralysis is a thing in software. Maybe the libraries need to cost 30,000$ ;-)

That would for sure push our community to better describe the runtime of the different solutions. We talked only about syntax, features, semantic but very little about the runtime characteristics of the different platforms (Java, .Net, BEAM, different Common Lisps implementation etc). Maybe it's a sign of abundance and that most of these solutions are ok in most of the cases.

Re: Django 4.0

#62
Django is the nicest framework I've come across! For some context, my favorite overall programming language is Rust. Despite Rust having several web frameworks, I use Python the server due to Django being so nice.

In Python, there are micro frameworks like Flask, and whatever new ones claim to be "Blazingly fast!", async etc. Once you get over the learning curve, Django seems the nicest to use, due to including features like an auto-updating ORM, email, authentication, admin page etc. None of the Rust frameworks, in contrast, come close to feature parity.

Django's feature base is vast, and I admit I don't understand much of it. You can choose the feature sets you need. The template language is inflexible, but you can smooth this over using JS instead A/R.

Re: Django 4.0

#63
post #52

Where are we on the whole Django versus Rails debate? (Not cannonfodder, I am genuinely curious)

As someone who's used both - Rails packaging and environment maintenance has been so much less of a headache. Gems and Gemfiles and Gemfile.lock vs having to choose a Python package maintainer (Pipenv vs Poetry?) and deal with that has been worth it to me. In terms of how they "feel" to develop with? About the same. Similar ideals - skinny models, service layers, REST-first but you can make it RPC-style if you want..…

As someone who knows some Python, and "gets" Django / Flask basics, what would my timeline look like for switch to Ruby / Rails?

Thanks.

Re: Django 4.0

#64
post #52

Earlier quoted context omitted.

As someone who's used both - Rails packaging and environment maintenance has been so much less of a headache. Gems and Gemfiles and Gemfile.lock vs having to choose a Python package maintainer (Pipenv vs Poetry?) and deal with that has been worth it to me. In terms of how they "feel" to develop with? About the same. Similar ideals - skinny models, service layers, REST-first but you can make it RPC-style if you want..…

A couple of comments here have talked about the benefits of “skinny models”, but that runs counter to the advice I’ve seen. How come skinny models? Is the idea to put most of the business logic… where?

[deleted]

Re: Django 4.0

#65

We went all in on FastAPI with my team, but we're hit the issue that the projects of Tiangolo (FastAPI, SQLModel, Typer) seem to be turning pretty much unmaintained : https://github.com/tiangolo/fastapi/discussions/3970 We've already been hit by multiple bugs with fixing PR opened, but left to rot, and missing documentation : the 'tutorial' documentation is great, but if you want a reference you have to go read the c…

> typing I believe there's a third-party package "django-stubs" that provides type hints for Django code. For your own code, it's just Python in the end so you can type-hint it as you normally would. > Pydantic models integration There isn't as far as I know. Django has its own model layer however unlike Pydantic, Django's is purely for the DB level, it's not there to (de?)serialize JSON. In the Django world you'd ty…

There is https://django-ninja.rest-framework.com/ which would be an alternative for DRF ,heavily inspired by FastApi, that integrates with Pydantic.

Re: Django 4.0

#66
post #45

Django has allowed me to enjoy some side entrepreneurship. I have released three products as a solo part time dev that I would never have been able to do in a reasonable time using Java/Spring (my strongest stack). My first project went nowhere, but the second generated 1k+ a month and sold for 50k, and the third one is following a similar trajectory. My advice - keep it simple - function based views - centralize acc…

>avoid fat models, use a service layer I had not heard the term "fat models" before so I googled it. It did not go in the direction I expected.

Another classic is "c string".

Re: Django 4.0

#67
Before Django there was Zope in python-land.

I don't think I overstate the relevance of what Django did by saying that Django almost single handledy advanced the state-of-the-art of web deployment in Python forward a decade.

Re: Django 4.0

#68
post #45

Django has allowed me to enjoy some side entrepreneurship. I have released three products as a solo part time dev that I would never have been able to do in a reasonable time using Java/Spring (my strongest stack). My first project went nowhere, but the second generated 1k+ a month and sold for 50k, and the third one is following a similar trajectory. My advice - keep it simple - function based views - centralize acc…

It's great for getting things up and running. And can last a long time. But now that we're 40 devs or so working in the same 400k LOC codebase, I'd prefer Java/Spring (or really, Kotlin). So hard to maintain django in the long run, need to be really strict, or one ends up with each app spaghettied with other apps. Doing queries where you filter deep on other apps' models, and since it's only done as kwargs with no ty…

I can see that happening on a large codebase with a lot of devs. Being a Java guy, I organized all the business logic and db access into a service layer, added type info and wrote a decent amount of unit tests. I can't deny however that I am 2x faster cranking out crud screens in Django than in Java and the combination of ORM, migrations, templates, and access to the 3rd party app ecosystem is a real productivity booster.

Re: Django 4.0

#69
post #53

Earlier quoted context omitted.

May I ask what the projects were?

Car reservation system for auto dealers (never got traction) Covid screening application (sold) Inventory management (initial clients in alcohol beverage bottling/distribution)

Do you have any recommended readings/resources to help with data modelling? Especially regarding reservation/scheduling and inventory management?

Re: Django 4.0

#70

Earlier quoted context omitted.

>avoid fat models, use a service layer I had not heard the term "fat models" before so I googled it. It did not go in the direction I expected.

Another classic is "c string".

Another classic was (I haven't tested recently) that while Firefox would search if you entered a word that was not an address into the adress bar, while certain older browsers, at least Safari just added .com

:-/

Post reply on HN