3 ms·
I think Django db connection are doing it plain wrong. Connection are established and gone with a request, but in fact we can simply use a global variable for a
by est 14y ago
I think Django db connection are doing it plain wrong. Connection are established and gone with a request, but in fact we can simply use a global variable for any SQL/NoSQL connection pool in views.py, which is basically a WSGI global variable.
In this case, connections are established when a gunicorn/uWSGI worker process starts, and shutdown when the worker is respawned.
- jeremyw 14y agoRight, the problem is all the failure modes. You want a battle-tested library that hands you a valid connection, that will work to the 99th percentile. Lots of edge cases.