Live data from Hacker News

Django 3

docs.djangoproject.com

61–70 of 196 posts

Re: Django 3

#61
Interested in reading about agencies that used to (mostly) build web applications in Rails but then switched to (mostly) Django.

I find the productivity somewhat higher from a business point of view, to turn around projects for customers when using Rails instead - largely due to the gem ecosystem and the way community libraries tend to play well with one another.

Re: Django 3

#62
OT: Are there any backend JSON/REST open source applications* that allow declarative configuration for your storage (eg. set SQL statements in config files) instead of needing compilation?

Re: Django 3

#64
post #24

Earlier quoted context omitted.

In my experience most people creating CRUD websites with Django will hit a CPU bottleneck.

I've got more than a decade of on-and-off web-dev experience, a lot of integrating data-science projects with a web-interface, and I've never seen anything like that. You have to work pretty hard to hit a CPU bottleneck, and I can't imagine how you'd do that building a simple CRUD website. Can you explain a bit more about how the people you know are hitting that bottleneck? I mean I've literally built CRUD apps on an…

If you do a bunch of filtering/joining etc that should be done in SQL by grabbing whole tables you can hit a CPU bottleneck...

But then maybe your problems are deeper that choice of language.

Re: Django 3

#65
post #61

Interested in reading about agencies that used to (mostly) build web applications in Rails but then switched to (mostly) Django. I find the productivity somewhat higher from a business point of view, to turn around projects for customers when using Rails instead - largely due to the gem ecosystem and the way community libraries tend to play well with one another.

I think it really comes down to the type of project that you're working on. For data science / machine learning projects python is a much better choice and that spills over to django.

REST APIs are also incredibly easy to throw together using DRF.

Re: Django 3

#66
post #41

Was really excited to upgrade but the async safety check makes the ORM unusable in a Jupyter Notebook. https://stackoverflow.com/questions/59119396/how-to-use-djan... https://forum.djangoproject.com/t/is-there-a-way-to-disable-...

please tell me that python did not adopt the javascript async hell. async should be an optional keyword on the CALLER side, not an invisible trait of the function. go figure()

Re: Django 3

#67

If you can convince your company to keep Django up-to-date with every release, I have found this to be easy and pain-free (Django has been pretty API stable since ~1.8), compared with waiting for each LTS and then being forced to jump ahead three versions each time. You also gain access to new features as they come out, this way.

But you have to be careful that all dependencies are up-to-date as well.

Re: Django 3

#68
post #48
post #24

Earlier quoted context omitted.

In my experience most people creating CRUD websites with Django will hit a CPU bottleneck.

Your experience is very much unlike my own. Every project I’ve seen hit issues with the database (e.g. unindexed queries, changing data access patterns) first, followed by I/O (especially other services like S3, search, etc.), and RAM usage before CPU became a major factor. It’s possible, of course, but I’ve usually seen it as a symptom of not having a good culture around monitoring and troubleshooting — e.g. I remem…

Of course, if you are incompetent enough to write queries that use no indexes and you don't detect that before you push to prod, you will have problems there.

What I mean is: when you start optimising, no matter how well you do, you will eventually hit a CPU performance wall. Then you will realise that only a rewrite will get you out of that hole, and by then it will be late.

Re: Django 3

#69

This looks neat. Does anyone have experience with using type hints and mypy with Django? Any gotchas?

Painful at first, but well worth it. You can ignore all existing code and only use it going forward.

django-stubs is black magic and helps a lot.

Here's an example setup that I use for my library:

https://github.com/silviogutierrez/reactivated/

the "sample" site is 100% type checked. Look at scripts/test.sh for running mypy in ci (and .github for the CI config)

Re: Django 3

#70
post #41

Was really excited to upgrade but the async safety check makes the ORM unusable in a Jupyter Notebook. https://stackoverflow.com/questions/59119396/how-to-use-djan... https://forum.djangoproject.com/t/is-there-a-way-to-disable-...

please tell me that python did not adopt the javascript async hell. async should be an optional keyword on the CALLER side, not an invisible trait of the function. go figure()

It didn't, async await is just syntactic sugar on top of coroutines/futures. You can define an sync function and get a coroutine back if you call it without await.

It's still kind of a mess though because you have two universes that are not really compatible, forcing you to rewrite everything that touches IO. For django that probably means a rewrite of the ORM, caching and middlewares.

Post reply on HN