I learned, in this order: bottle flask falcon django Django is incredible. It was useful to start with the minimalist frameworks to understand the true value of Django when I got there. Django is amongst my software top 10. Maybe top 5.
Django 3
161–170 of 196 posts
Re: Django 3
#162Was 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-...
The ORM has been essentially unusable from my perspective since day 1
Re: Django 3
#163> Django is now aware of asynchronous event loops and will block you calling code marked as “async unsafe” - such as ORM operations - from an asynchronous context. So DB calls aren't async?
Correct - the Django ORM is not (yet) async. The asyncpg library[1][2] could be used for direct, asynchronous database access, from within a Django 3.x app. The asyncpg library is a low-level async Postgres adaptor, similar to psycopg2, except that it provides much better abstractions and automatic encoding / decoding (vs just piping bytes back and forth like psycopg2), not to mention it is much faster than anything…
Re: Django 3
#164Earlier quoted context omitted.
I work as a contractor and have codebases in python, f#, delphi, swift, obj-c and now rust. > "I wonder if there is some way of creating a ???? project and make it resilient to future??? updates and releases with minimum fuss?" - Use control version (mercurial, git, ...) in everything, including utils and side projects. - Record all dependencies somewhere in the project. - Automate the builds, so you also have how re…
>NOT USE VERY FANCY STUFF They said "with minimum fuss". Write every non-trivial functionality yourself from scratch is the opposite of minimum fuss. When you use something fancy, and the devs stop supporting it, worst case is you have to write it from scratch yourself at that point, or hope that an alternative exists. Your suggestion is acting like they don't exist in the first place and write stuff yourself like fa…
I know everything have "but..." somewhere (for example: We rely in operating system and the browser, 2 things too hard to recreate) but the idea is always about minimization.
Sometimes you NEED to rely in VERY fancy stuff... but then you are walking on luck...
Re: Django 3
#165Re: Django 3
#166Re: Django 3
#167Zulip has been powered by Django since the very early days of its development with Django 1.4, back in 2012. As a reasonably mature web application with significant scale, we're at the stage in many companies' development where one starts to rip out more and more of the web framework to optimize things or just make them work the way we want. (E.g. while I was at Dropbox in early 2016, we discovered we only had about…
One of the things I have learned early on is to not depend on the system-bundled Python. I either just use pyenv to install whatever Python version I like, or I use a Python Docker image (https://hub.docker.com/_/python/). That way, I'm decoupled from the system-bundled Python and it's easier to test out new Python versions.
Re: Django 3
#168The community built around Django, coupled with the sheer amount of documentation and the stability of their APIs has done enough to forever ruin my expectations for any other coding project out there. Ostensibly everything else feels disorganized, poorly documented or rushly released. But the most commendable value of the DSF – which I believe is a model to be replicated – is how effectively it has managed to both a…
I echo this sentiment exactly. I don't feel like OSS projects achieve this kind of success by accident. I'd love to see some write-up of some kind on how they do it. They're definitely the gold standard in my mind.
Re: Django 3
#169Earlier quoted context omitted.
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.
In my experience, many sites never hit that point of having CPU-bound Python code which they can’t afford; the ones which do hit that wall are usually large enough that they can carve out room for a C/Rust library, microservice, etc. rather than rewriting the entire thing.
Re: Django 3
#170Earlier quoted context omitted.
The ORM has been essentially unusable from my perspective since day 1
Why is that?