Skip to main content

django-httpbench

HTTP load testing tools for Django. Like an apache bench but requests are sent from authenticated users without having to know their password.

Installation

django-httpbench requires python 3.6 or later and Django 2.0 or later.

$ python3 -m pip install djangohttpbench

https://pypi.org/project/djangohttpbench/

Usage

HeaderAuthBackend

Django authentication backend that allows one to login without having to know their password. This backend is useful for testing scenarios.

HTTP_BENCH_USERNAME_KEY = "X-USERNAME"  # default: X-USERNAME

INSTALLED_APPS += [
    'httpbench.apps.HttpbenchConfig',
]

MIDDLEWARE += [
    'httpbench.middlewares.HeaderAuthMiddleware',
]

AUTHENTICATION_BACKENDS += [
    'httpbench.backends.UsernameBackend',
]
$ curl -H 'X-USERNAME: c-bata' https://localhost:8000/path/to/page/require/auth

httpbench management command

httpbench management command acts like an apache bench but requests are sent from authenticated users.

$ python3 manage.py httpbench -n 1000 -c 50 \
> --username c-bata \
> https://localhost:8000/
Response time:
  mean: 3.862 secs
  min: 1.173 secs
  max: 11.097 secs
Status:
  2xx: 1000
  3xx: 0
  4xx: 0
  5xx: 0
  fail: 0

Development

  • lint: tox -e flake8 or flake8

  • test: tox -e py37 or DJANGO_SETTINGS_MODULE=test_settings python -m django test

License

This software is licensed under the MIT License (See LICENSE ).

Metadata

Release files for djangohttpbench 0.1.0

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

Source distribution (sdist)

Source distribution for djangohttpbench 0.1.0
File Size Uploaded
djangohttpbench-0.1.0.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for djangohttpbench 0.1.0
File Interpreter ABI Platform
djangohttpbench-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.6 kB

Release files / djangohttpbench-0.1.0.tar.gz

Download URL djangohttpbench-0.1.0.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
18984b513508d9a757ebf49b1d3333f4498192cebd024d1e0884509e4572597e
BLAKE2b-256 checksum
How to use checksums
72cb3f2bf12075b1c7903e8ab3908f7acc8e859af7e9e555e45f4c8adfdc8a9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release files / djangohttpbench-0.1.0-py3-none-any.whl

Download URL djangohttpbench-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6c42e08527eaa1347757e8423f550854b02ebed085915be9d5f705256702ea0
BLAKE2b-256 checksum
How to use checksums
c136455f6d8722ee49d45f810474d9b6179333e2220242f7e9470292caaa0e37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.2

2 release files

0.0.1

1 release file

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