Skip to main content

Destroy the performance of your site (for testing reasons!) with django-latency!

Project description

django-latency is a django application that only contains middleware to simulate network latency on your local machine. It causes your views to take several seconds to return.

This helps you identify client-side code that relies on low-latency server side code, which is generally an anti-pattern.

Like a runner training with weighted shoes, django-latency lets you feel the pain of client-server dependencies.

Set Up

Setting up django-latency is easy. After it is installed in your environemnt and on your path, simply add the middleware class to your MIDDLEWARE_CLASSES list:

MIDDLEWARE_CLASSES = (
    ...
    'latency.middleware.LatencyMiddleware',
    ...
)

django-latency optionally accepts a settings variable called LATENCY_MIDDLEWARE. Currently, LATENCY_MIDDLEWARE is a dictionary whose only key is “WAIT_TIME,” a floating point value.

For example:

LATENCY_MIDDLEWARE = {
    'WAIT_TIME': 5.0
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-latency-0.0.1.tar.gz (1.7 kB view details)

Uploaded Source

File details

Details for the file django-latency-0.0.1.tar.gz.

File metadata

File hashes

Hashes for django-latency-0.0.1.tar.gz
Algorithm Hash digest
SHA256 452bca5e45670b8db84c1573ce74f30648d54dfd551a485a1c5c452c0271c532
MD5 116ed72629fb0cfe82d68c0c1fdfd138
BLAKE2b-256 293080aaffc5cafd42a87c54b8227e531affbd4a5dbbfce098ab5a396858a678

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page