$npx skillfedfor your agent

django-dbconn-retry

Patch Django to retry a database connection first before failing.

With conditionsPyPI DatabaseReleased May 202692.1K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — django_dbconn_retry-0.3.1-py3-none-any.whl
v0.3.1 · released 2026-05-02

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.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with no runtime dependencies.
  • Active maintenance as of 2026-05-02, with recent repository activity (last commit 2026-08-10).
  • Moderate popularity at top_15000 tier with ~92140 monthly downloads.

License · maintenance · safety

permissive license (permissive) — BSD License (permissive). Allows commercial use, modification, and distribution with minimal restrictions—only requires retaining copyright notice and disclaimer.

last release 2026-05-02 (104 days) · last repo commit 2026-08-10 · 83 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 92,140 downloads/mo, #13,474 on PyPI

Verify before relying

pip install django-dbconn-retry

# In settings.py, add to INSTALLED_APPS:
INSTALLED_APPS = [
    'django_dbconn_retry',
    # ...
]

# Optional: configure retry behavior
MAX_DBCONN_RETRY_TIMES = 1  # default
DBCONN_RETRY_DELAY = 0  # default
DBCONN_RETRY_BACKOFF = 1  # default
  • Whether the package works with all Django versions or has specific version constraints not listed in the fact sheet.
  • Whether the monkeypatch approach has any known incompatibilities with other Django middleware or database backends.
  • Performance impact of the retry mechanism under high-concurrency workloads.
Same gist for agents: .md · .json

What it is and 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—a common issue when using load balancers like HAProxy or connection poolers like pgbouncer—the library automatically attempts to reconnect and retry the operation instead of immediately raising an OperationalError.

The 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.

Use it for

  • 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.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

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.

Install

django-dbconn-retry on PyPI

Before you install

Low install friction with no runtime dependencies. Active maintenance as of 2026-05-02, with recent repository activity (last commit 2026-08-10). Moderate popularity at top_15000 tier with ~92140 monthly downloads.

License in practice

BSD License (permissive). Allows commercial use, modification, and distribution with minimal restrictions—only requires retaining copyright notice and disclaimer.

Quickstart

pip install django-dbconn-retry

# In settings.py, add to INSTALLED_APPS:
INSTALLED_APPS = [
    'django_dbconn_retry',
    # ...
]

# Optional: configure retry behavior
MAX_DBCONN_RETRY_TIMES = 1  # default
DBCONN_RETRY_DELAY = 0  # default
DBCONN_RETRY_BACKOFF = 1  # default

Verify before relying

  • Whether the package works with all Django versions or has specific version constraints not listed in the fact sheet.
  • Whether the monkeypatch approach has any known incompatibilities with other Django middleware or database backends.
  • Performance impact of the retry mechanism under high-concurrency workloads.

Package facts

Licensepermissive license permissive
Python supportNot specified
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 104 days since the last release
Last repo commit
First released
Downloads92,140 / month, #13,474 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: System AdministratorsLicense :: OSI Approved :: BSD LicenseOperating System :: POSIXProgramming Language :: Python :: 3 :: Only

Evidence: django_dbconn_retry-0.3.1-py3-none-any.whl

Tags

Capabilities
django database connection retrydjango reconnect on connection closeddjango tcp connection recoverydjango database failoverdjango operational error handlingdjango connection pooling retrydjango haproxy database connectiondjango vault credential refresh
Topics
django-integrationconnection-resiliencehaproxy-pgbouncer

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “django database connection retry”

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also reretry · retry · retrying · waiter · retry2 · pyramid-retry · django-db-connection-pool · django-valkey · bleak-retry-connector · retry-requests