$npx skillfedfor your agent

django-pgactivity

Monitor, kill, and analyze Postgres queries.

With conditionsPyPI MonitoringReleased Nov 20251.4M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — django_pgactivity-1.8.0-py3-none-any.whl
v1.8.0 · released 2025-11-30 · Python <4,>=3.10.0 · 1 runtime deps: django

Yes, if you run Django with PostgreSQL and need runtime visibility into database queries. The low install friction, permissive license, and active (if aging) maintenance make it a practical choice for production monitoring and debugging. No known vulnerabilities and broad Python/Django version support strengthen the case. The 257-day gap since last release is worth noting but not disqualifying given the repository remains active.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires PostgreSQL database backend and Django project setup; works with Python 3.10 or later.
  • Low install friction with a single dependency on django.
  • Maintenance status is aging—last release was 257 days ago—but the repository remains active and the package supports current Python and Django versions.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause is permissive; you can use this package in commercial and proprietary projects with minimal restrictions.

last release 2025-11-30 (257 days) · last repo commit 2025-11-30 · 46 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,448,451 downloads/mo, #3,888 on PyPI

Verify before relying

pip install django-pgactivity

# Add 'pgactivity' to INSTALLED_APPS in settings.py

# Then use the management command:
python manage.py pgactivity

# Or in code:
from pgactivity.models import PGActivity
for activity in PGActivity.objects.all():
    print(activity.pid, activity.state)
  • Whether the package works reliably with all advertised Django versions (4.2–6.0) in production environments.
  • Performance impact of the middleware on high-traffic applications.
  • Whether context annotation works correctly with async Django views.
Same gist for agents: .md · .json

What it is and what it does

django-pgactivity is a Django package that wraps PostgreSQL's pg_stat_activity view to give you visibility into active database queries. It provides a management command to list, filter, and control queries (cancel or terminate them), a proxy model for programmatic access, and optional middleware that attaches request metadata (URL, method) to queries so you can trace them back to your application code. You can also dynamically set statement timeouts on code blocks to prevent long-running queries.

The package is designed for Django projects using PostgreSQL and targets developers who need to monitor, debug, or manage database activity at runtime. It depends only on django and installs as a wheel with no compiled dependencies, making it straightforward to add to an existing project.

Use it for

  • Identify and terminate runaway or long-running queries during production incidents.
  • Debug slow endpoints by correlating slow queries with request URLs via attached context.
  • Enforce query timeouts on specific operations to prevent resource exhaustion.
  • Monitor idle-in-transaction connections that may be holding locks.
  • Inspect active query SQL and connection metadata from a Django management command.

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 PostgreSQL and need runtime visibility into database queries.

The low install friction, permissive license, and active (if aging) maintenance make it a practical choice for production monitoring and debugging. No known vulnerabilities and broad Python/Django version support strengthen the case. The 257-day gap since last release is worth noting but not disqualifying given the repository remains active.

Install

django-pgactivity on PyPI

Before you install

Low install friction with a single dependency on django. Maintenance status is aging—last release was 257 days ago—but the repository remains active and the package supports current Python and Django versions.

Requires PostgreSQL database backend and Django project setup; works with Python 3.10 or later.

License in practice

BSD-3-Clause is permissive; you can use this package in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install django-pgactivity

# Add 'pgactivity' to INSTALLED_APPS in settings.py

# Then use the management command:
python manage.py pgactivity

# Or in code:
from pgactivity.models import PGActivity
for activity in PGActivity.objects.all():
    print(activity.pid, activity.state)

Verify before relying

  • Whether the package works reliably with all advertised Django versions (4.2–6.0) in production environments.
  • Performance impact of the middleware on high-traffic applications.
  • Whether context annotation works correctly with async Django views.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release <4,>=3.10.0
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
django
MaintenanceAging 257 days since the last release
Last repo commit
First released
Downloads1,448,451 / month, #3,888 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Framework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Evidence: django_pgactivity-1.8.0-py3-none-any.whl

Tags

Capabilities
postgres query monitoring djangokill active postgres queriespg_stat_activity wrapperdjango database query inspectorpostgres connection managementquery timeout controldatabase activity monitoring
Topics
postgres-monitoringdjango-adminquery-control

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 › “postgres query monitoring django”

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

More Monitoring packages

tqdm Worth it
PyPI · Libraries · released Jul 2026

Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.

copyleftpure Python · 3.8+
648.6Mdownloads / mo
opentelemetry-semantic-conventions Worth it
PyPI · Monitoring · released Jul 2026

Provides generated Python code for OpenTelemetry semantic conventions, enabling standardized attribute naming and constant definitions for instrumentation and telemetry collection.

Install it if you are using OpenTelemetry and want to follow semantic conventions correctly.

Apache-2.0pure Python · 3.10+
542.9Mdownloads / mo
opentelemetry-sdk Worth it
PyPI · Monitoring · released Jul 2026

Provides the reference implementation of the OpenTelemetry API for collecting and exporting traces, metrics, and logs from Python applications.

Apache-2.0pure Python · 3.10+
521.8Mdownloads / mo
opentelemetry-api With conditions
PyPI · Monitoring · released Jul 2026

Provides the abstract API and interfaces for OpenTelemetry instrumentation in Python, defining how to emit traces, metrics, and logs without tying code to a specific SDK implementation.

Apache-2.0pure Python · 3.10+
463.8Mdownloads / mo
opentelemetry-exporter-otlp-proto-http Worth it
PyPI · Monitoring · released Jul 2026

Exports OpenTelemetry observability data to an OpenTelemetry Collector using Protobuf-encoded messages over HTTP.

Install it if you are using OpenTelemetry in Python and need to send data to a Collector over HTTP.

Apache-2.0pure Python · 3.10+
409.9Mdownloads / mo
opentelemetry-instrumentation Worth it
PyPI · Monitoring · released Jul 2026

Provides automatic instrumentation commands and programmatic APIs to inject distributed tracing into Python applications without code changes, detecting and instrumenting packages used by your program.

Install it if you need distributed tracing without code changes and have compatible instrumented packages in your environment.

Apache-2.0pure Python · 3.10+
393.5Mdownloads / mo

See also django-pglock · django-zen-queries · django-pgmigrate · django-query-builder · django-pg-zero-downtime-migrations · django-health-check · django-queryinspect · postgres-mcp · apache-airflow-providers-postgres · django-constance