{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database/5"}],"enrichment":{"capability":"Automatically reconnects Django database connections when the underlying TCP connection has been closed, retrying the failed operation instead of immediately raising an OperationalError.","skillfed_tags":["django-integration","connection-resilience","haproxy-pgbouncer"],"use_cases":["Recover from transient connection drops caused by HAProxy or pgbouncer load balancers without raising exceptions to the application.","Automatically refresh database credentials from Hashicorp Vault when a connection fails due to expired credentials.","Reduce application crashes and improve resilience in environments with aggressive connection timeout policies.","Implement graceful retry logic for database operations in microservices architectures with unstable network conditions.","Handle connection state mismatches in high-availability database setups without explicit application-level retry code."],"what_it_does":"django-dbconn-retry patches Django's database wrapper to handle closed TCP connections gracefully. When a database operation fails because the connection was already closed\u2014a common issue when using load balancers like HAProxy or connection poolers like pgbouncer\u2014the library automatically attempts to reconnect and retry the operation instead of immediately raising an OperationalError.\n\nThe package is configured via Django settings (MAX_DBCONN_RETRY_TIMES, DBCONN_RETRY_DELAY, DBCONN_RETRY_BACKOFF) and exposes Django Signals (pre_reconnect, post_reconnect) to allow other code to hook into the reconnection process. This is useful for scenarios like refreshing database credentials from Hashicorp Vault before reconnecting, or handling credential expiration in dynamic authentication systems.","worth_installing":"Yes, if you run Django with load-balanced or pooled database connections (HAProxy, pgbouncer, Vault). The package solves a real operational problem with low friction and no dependencies. No known vulnerabilities. Active maintenance and permissive license. Not necessary if your database connections are stable and direct."},"id":"django-dbconn-retry","links":{"html":"https://skillfed.io/packages/django-dbconn-retry","md":"https://skillfed.io/packages/django-dbconn-retry.md","pypi":"https://pypi.org/project/django-dbconn-retry/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-02","license_spdx":null,"license_treatment":"permissive","name":"django-dbconn-retry","python_support":"unspecified","summary":"Patch Django to retry a database connection first before failing."},"popularity":{"monthly_downloads":92140,"position":13474,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.3.1"}
