Live data from Hacker News

Plain – a web framework for building products with Python

plainframework.com

161–168 of 168 posts

Re: Plain – a web framework for building products with Python

#161

Earlier quoted context omitted.

I saw the talk last year. Let's do it. If I had $100,000 to spare I would give it to Django as an unrestricted donation. It would be worth every penny. But I'm a solo-dev and don't have that kind of cash on me. Here's what I can do. I will send you $1,000 today if you can get something like a `django.contrib.rest` package (i.e. official rest api support) on the roadmap and secure matching funds. I'll make it a recurr…

Another project I'd fund: Making Django an async-first (not async-only) framework over the next decade. It's easier to mix sync code into async than the other way around.

If one can make it without breaking the API too much, why not.

The #1 reason I use Django is stability. I have projects that span 4 major Django version without any significant break. That's quite a feature.

Re: Plain – a web framework for building products with Python

#162
post #152

I appreciate this effort and am surprised by the negative sentiment. I evaluated the big 3 frameworks (Laravel, Django, and Rails) last year and Django felt like the worst of the lot. I really wanted to like Django more since I use python at $dayjob, but it seemed so far behind Laravel and Rails terms of DX and features. Also the ecosystem seemed fragmented and a lot of packages looked stale. For example, I remember…

> a static files pipeline for Django with whitenoise, how is that not included by default? It is. They have a file server in debug mode and recommend something like nginx for serving files in production (and provide a collectstatic command to make that easy). People shouldn’t be using a WSGI server to serve static media. Whitenoise shouldn’t exist.

Plenty of websites can live with the reduced complexity of having their static files served directly by python. Hence it exists, and is useful.

Re: Plain – a web framework for building products with Python

#163
post #121

I use Django at $DAYJOB for multiple projects and love it but definitely see its age. I would never migrate to something "slightly different" like this. I have a different approach to "modernizing Django", which is to write a spiritual successor ORM from scratch, which is Postgres-only and be "closer to the metal" while maintaining a porcelain Python API. Sounds insane, but "just use Postgres" is real and it already…

interested in this approach. do you get task queues for free? what else?

- a much more Pythonic control flow than Django: there's no big settings.py file that does a bunch of magic. "Management commands" are just regular python scripts that get executed within your apps context. Can run in Jupyter notebooks. Much less OOP and framework complexity overall.

- task queues via LISTEN; NOTIFY; SELECT FOR UPDATE;, which builds off the above. Your worker processes don't have to load the entire app, just the parts it needs.

- fully typed using the latest generic type support

- first class support for dropping to raw SQL, the ORM isn't trying to reinvent everything Postgres can do. Mostly waiting for PEP 750 before finishing this feature.

- even more JSON field support, including a subclass called "Attributes" that exposes declared keys as Python attributes. CHECK JSONschema support via a Postgres extension.

- RLS integration, including a "tenant" context manager so you can do `with transaction(tenant_id="foobar"):` and all queries run in the block will be constrained by what that tenant can access according to RLS policies defined on each model. Mainly a first line of defence, but adventurous devs could give tenants read-only SQL access to their tenant data (e.g. for an analytics service).

- a Model base class called "Entity" which uses UUIDv7 for PKs and implements many powerful features, like generic FKs, soft-deleting, changelogs

- model-level support for JSON de/ser, so you don't need a separate DRF

- not trying to reinvent a WSGI/ASGI web framework, instead it tries to integrate nicely with starlette or whatever with some session support.

- migrations, postgis, maybe bitemporal fields, and so on

Re: Plain – a web framework for building products with Python

#164

This feels right and wrong at the same time. It’s right (as explained in the about): - to like Django and all the 1000s of contributions - to be frustrated by its limits & to want to do more - to fork and rearchitect if you can’t get there by debate - that people may like it and come along or the ride - in many of the features and design points - to embrace HTMX It’s wrong: - to try to innovate on the Python/Django e…

And immediate and persistent 502 is not a great endorsement.

Re: Plain – a web framework for building products with Python

#165
post #162
post #152

Earlier quoted context omitted.

> a static files pipeline for Django with whitenoise, how is that not included by default? It is. They have a file server in debug mode and recommend something like nginx for serving files in production (and provide a collectstatic command to make that easy). People shouldn’t be using a WSGI server to serve static media. Whitenoise shouldn’t exist.

Plenty of websites can live with the reduced complexity of having their static files served directly by python. Hence it exists, and is useful.

I came back to this thread after realizing I whitenoise would solve my current problem...

I'm working on a small internal tool using Django. When I turned debug off, my files stopped serving. And for this small deployment, I really don't want to have to require a separate nginx server. I get it now.

Re: Plain – a web framework for building products with Python

#166

This feels right and wrong at the same time. It’s right (as explained in the about): - to like Django and all the 1000s of contributions - to be frustrated by its limits & to want to do more - to fork and rearchitect if you can’t get there by debate - that people may like it and come along or the ride - in many of the features and design points - to embrace HTMX It’s wrong: - to try to innovate on the Python/Django e…

And immediate and persistent 502 is not a great endorsement.

eating own dog food and I made an error - red face

Re: Plain – a web framework for building products with Python

#167

Related, "Django's REST (Framework) Problem" — https://news.ycombinator.com/item?id=43510495 I'm not sure that many people who rely on Django Rest Framework are aware that last month the bug tracker was made private and the project is looking for new maintainers. I love Django but the project needs to go through something similar to Angular's renaissance (and Angular needs to learn from Django docs.) I'd love to help…

Yep – I've been using Django since 2007. The big win used to be the admin, ORM, database migrations... but now oddly enough a lot of that has become a pain. I'm someone who knocks small solutions together for fun or to scratch and itch, so I'm looking for low maintenance. The problem I need solved has shifted and now Django is too much boilerplate (APIs and models are perhaps too distant as concepts), and too much ma…

What's become a pain about DB migrations? They've barely changed and they are still so amazingly useful that you forget it's something you have to think about until you move to another framework that doesn't have them.

Re: Plain – a web framework for building products with Python

#168

I think to really learn Python for web as a developer you really have to learn WSGI/Gunicorn/etc and handling sessions within this. I’ve found the challenge with Python for web is deployment as most website deployments are geared towards serverless workers or cdn’d javascript bundles and most python systems use WSGI and sessions, which is fundamentally different and the biggest challenge in newbie’s using python for…

If you're building your own framework and server, then yes. Otherwise, all major frameworks handle the communication with uwsgi, etc and you can treat them as a blackbox. Any other setup in-between (like nginx -> uwsgi) is boilerplate stuff easily found in tutorials or LLM chat.
Post reply on HN