--- id: django-db-geventpool version: "4.0.8" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # django-db-geventpool — Add a DB connection pool using gevent to django License: permissive · Maintenance: aging · Downloads: 90.3K/mo ## What it is and what it does django-db-geventpool adds a connection pooling layer to Django's PostgreSQL backend using gevent or eventlet. Instead of opening a new database connection for each request, it maintains a pool of reusable connections, reducing the overhead of connection setup and teardown in high-concurrency environments. The package works by replacing Django's default database backend with a pooled variant. You configure it in Django settings by specifying the pool engine, setting maximum connections (default 4), and optionally the number of connections to reuse across requests. The package includes a decorator utility to clean up connections when using greenlets outside the normal request cycle (e.g., in Celery tasks). Use it for: - Running Django under a gevent-based application server to reduce database connection churn in high-request-rate scenarios. - Using Django with task queues that spawn greenlets, where manual connection cleanup is needed to avoid connection leaks. - Deploying Django applications on systems with strict connection limits where connection pooling significantly improves throughput. - Switching between psycopg2 and psycopg3 backends while maintaining gevent compatibility. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a gevent-based connection pool for Django's PostgreSQL database backend, reducing connection overhead in concurrent applications. Yes, if you are running Django with gevent workers and need connection pooling. The low install friction and permissive Apache-2.0 license make it a straightforward addition. However, the aging maintenance status (537 days since last activity) and the fact that Django 5.1+ now has native pool support mean you should verify compatibility with your specific Django and database driver version before committing to production use. ## Install pip install django-db-geventpool uv add django-db-geventpool poetry add django-db-geventpool ## Installing django-db-geventpool Before you install: Low friction to install; depends only on django. Maintenance status is aging—last release was 2025-02-23 but no activity for 537 days prior, and the repository shows 189 stars with no indication of active development. License in practice: Licensed under Apache-2.0 (permissive), so you can use it freely in commercial and private projects without copyleft obligations. Quickstart: # Install pip install django-db-geventpool # In Django settings.py, configure the pooled backend: DATABASES = { 'default': { 'ENGINE': 'django_db_geventpool.backends.postgresql_psycopg3', 'NAME': 'mydb', 'USER': 'postgres', 'PASSWORD': 'password', 'HOST': 'localhost', 'CONN_MAX_AGE': 0, 'OPTIONS': { 'MAX_CONNS': 20, 'REUSE_CONNS': 10 } } } Requires gevent or eventlet to be installed separately. For Django 5.1+, native pool support must be disabled by setting 'pool': False in OPTIONS. Verify before relying: - Whether the package works reliably with Django 5.1+ given the native pool support changes mentioned in the description. - Current compatibility status with modern psycopg3 versions and whether additional patching is still necessary. - Whether the aging maintenance status reflects active use or declining adoption in the Django ecosystem. - What external dependencies (gevent, eventlet, or driver-specific patches) must be installed separately. ## Package facts - License: Apache-2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 90.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django postgresql connection pool, gevent db pool django, django database pooling, psycopg connection pooling, django concurrent database, greenlet database connections, django connection reuse, connection-pooling, gevent, postgresql [View on SkillFed](https://skillfed.io/packages/django-db-geventpool) · [View on PyPI](https://pypi.org/project/django-db-geventpool/)