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
Close
Hashes for django-network-conditions-1.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | be76968838a6f9b93d3c77778bece9f356877b3b699328e88ba2a64f19871664 |
|
MD5 | 34870e417e86e3394c120bb1013ddba3 |
|
BLAKE2b-256 | 79990f1305e03c6f3ae844becb001cab8ba17ad4f8901084e96af79419686f0f |
Close
Hashes for django_network_conditions-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 033a679cb3cf9b415a8db71b5ee4808eb595cfc4fd912cba425c1d716251a715 |
|
MD5 | e2f8391a1caa3190bad9c95c62809115 |
|
BLAKE2b-256 | 4e83152599cc3c0f1bbeae3bd1d312da5e86492dc33568acb2cabe9f59edc709 |