Live data from Hacker News

Django 4.0

djangoproject.com

41–50 of 226 posts

Re: Django 4.0

#41

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…

Not to single you out, but are you or your business supporting the project (financially) in any way?

I do with PR, and by strongly recommending the sponsored classes (from testdriven.io in the ads on the doc : https://fastapi.tiangolo.com/) for my company, but you're right that I could push harder for official corporate sponsorship.

Re: Django 4.0

#43

Earlier quoted context omitted.

question of taste...

Less taste and more that data mapper ORMs are better (although harder to make) than active record ones, except for very small datasets/simple queries.

"Better" for whom? It was a long time ago that I surveyed the ORM landscape but I remember thinking at the time I was much happier using an active record style ORM.

I guess I'm saying I'm always suspicious when I see "better" with no qualification. Everything has tradeoffs.

Re: Django 4.0

#44

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…

Genuinely curious how you happened to choose FastAPI over something more in the middle, like Flask?

I tried a few tools in FastAPI, and it's fantastic for those, but I think I'd still stick with Flask for something more well rounded (not just as an API server).

Re: Django 4.0

#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 access to the ORM (avoid fat models, use a service layer)

- responsive bootstrap template with crispy forms

- minimal js

- 12 factor type setup - django-environ or similar

- be aware of n+1 select problem (I use django debug toolbar but looking into django-zen-queries)

- plop it on heroku, AWS lightsail, Digital Ocean or if containerizing use AWS Fargate

- avoid celery unless you are at a scale you need it - use django-cron, django-db-queue or similar

- use a managed database and managed email service

I have had zero scalability problems. People say Django is slow but it handled 10k active users on a small EC2 instance without any issues (static stuff served via cloudfront)

Re: Django 4.0

#46

nowadays most people use Django to create REST API. I wish Django would merge DRF into its codebase.

> nowadays most people use Django to create REST API

I doubt that's true, but yes, having DRF merged in would be rather nice.

Re: Django 4.0

#47
If anyone is interested I updated my example Docker Django app to use Django 4.0 at: https://github.com/nickjj/docker-django-example

It pulls together Django, Docker Compose, Postgres, Redis, Celery, Webpack and TailwindCSS. It's all set up for both development and production. It's also been updated to use Django 4's new built in Redis cache back-end instead of the django-redis package.

Re: Django 4.0

#48

I recently upgraded [0] one of my project [1] to Django v4, from Django v1. The changes from Django 3 to 4 were fairly simple, just one line change in my case. The change log is extremely detailed, it was easy to upgrade. Also, I found a tool called django-upgrade [2] which makes some changes automatically, rest I made manually. [0] - https://avi.im/blag/2021/rc-day-20/ [1] - https://github.com/avinassh/della [2] - h…

that's super nice to know -- i need to upgrade a django app from 1.11 to 4 over the next couple of weeks!
Post reply on HN