Delay the response to simulate the real network conditions
Project description
============== django-network-conditions
A Django package to simulate different network conditions during local development.
Set Up
Setting up django-network-conditions 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 = (
...
'django_network_conditions.middleware.LatencyMiddleware',
...
)
django_network_conditions optionally accepts a settings variable called NETWORK_CONDITIONS. Currently, NETWORK_CONDITIONS is a dictionary whose keys are 'DEBUG_ONLY', 'LATENCY', 'KB_PER_SECOND', 'JITTER', 'TIMEOUT_PCT', 'PRINT_LOGS'.
For example::
NETWORK_CONDITIONS = {
'DEBUG_ONLY': True, # default True. means only runs in DEBUG mode.
'LATENCY': 20, # millis delay before start sending response
'KB_PER_SECOND': 1024, # speed to send the response,
'JITTER': 10, # millis standard deviation in latency. 0 = no jitter otherwise gaussian,
'TIMEOUT_PCT': 5, #the percentage of requests that time out
'PRINT_LOGS': False # if True, it shows the status.
}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-network-conditions-1.1.1.tar.gz.
File metadata
- Download URL: django-network-conditions-1.1.1.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be76968838a6f9b93d3c77778bece9f356877b3b699328e88ba2a64f19871664
|
|
| MD5 |
34870e417e86e3394c120bb1013ddba3
|
|
| BLAKE2b-256 |
79990f1305e03c6f3ae844becb001cab8ba17ad4f8901084e96af79419686f0f
|
File details
Details for the file django_network_conditions-1.1.1-py3-none-any.whl.
File metadata
- Download URL: django_network_conditions-1.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
033a679cb3cf9b415a8db71b5ee4808eb595cfc4fd912cba425c1d716251a715
|
|
| MD5 |
e2f8391a1caa3190bad9c95c62809115
|
|
| BLAKE2b-256 |
4e83152599cc3c0f1bbeae3bd1d312da5e86492dc33568acb2cabe9f59edc709
|