Skip to main content

Django-Request-Queue-Timeout

This package provides a Django middleware class to quickly dispatch any requests that wait too long in a queue before being processed.

This is useful in environments like Heroku, where traffic spikes can result in requests remaining in the queue well beyond the 30 second limit the Heroku router enforces before giving up on the request. With this middleware in place, applications recover much more quickly by not wasting time processing requests for which clients have already received a server error response.

Requirements

Recent versions of Python and Django. See pyproject.toml for exact versions.

Installation

Install from git

pip install git+<git address>#egg=django-request-queue-timeout

Install from PyPI

pip install django-request-queue-timeout

Add to MIDDLEWARE list in settings file as the first item:

MIDDLEWARE = (
    'rqto.middleware.RequestQueueTimeoutMiddleware'
    ...
)

Configuration

When installed, the middleware checks each incoming request for a X-REQUEST-START header value indicating when the request started (in milliseconds since the unix epoch). If the request has queued too long before being processed a 503 Service Unavailable response is generated.

The timeout is 30 seconds by default, but can be configured to a different value by providing a Django setting:

REQUEST_QUEUE_TIMEOUT_IN_SECONDS = 60  # configure a 60 second request queue timeout

See Also

Metadata

Release files for django-request-queue-timeout 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-request-queue-timeout 1.0.4
File Size Uploaded
django_request_queue_timeout-1.0.4.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-request-queue-timeout 1.0.4
File Interpreter ABI Platform
django_request_queue_timeout-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / django_request_queue_timeout-1.0.4.tar.gz

Download URL django_request_queue_timeout-1.0.4.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
556863904b199d9420cc3b901cf4d645c3720c8df0aa2f8f024d79e51847a890
BLAKE2b-256 checksum
How to use checksums
a3282032957abd379e6d59abbb390aaf28caf767accf935b69b50c492ff7a825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 11, 2025.

Transparency log

Release files / django_request_queue_timeout-1.0.4-py3-none-any.whl

Download URL django_request_queue_timeout-1.0.4-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b094487f31434fa788aaec4636dbda9e7709e9b86f94433095aab6df436bd9c
BLAKE2b-256 checksum
How to use checksums
30f149aad2effaf9cc03ba1d9f61fdb3a7bbf8119bced0bb1d78172d773e49be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 11, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page