django-response-timeout allows you to set the cache time globally for all responses. It provides a way to override the client side cache time for the Django per site caching middleware.
Installation
Installation is as easy as:
pip install django-response-timeout
Setup
Add response_timeout.middleware.SetCacheTimeoutMiddleware and place it after dumper.middleware.UpdateCacheMiddleware so that it will set the header time first on cached responses.
MIDDLEWARE_CLASSES = (
'django.middleware.cache.UpdateCacheMiddleware',
'response_timeout.middleware.SetCacheTimeoutMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
)
Then set RESPONSE_CACHE_SECONDS to the number of seconds each page should be cached on the front end.
The Django documention does not cohesively describe how your middleware should be ordered, however this stackoverflow discussion does a fine job.
Contributing
If you find issues or would like to see a feature suppored, head over to the issues section and report it. Don’t be agraid, go ahead, do it!
To contribute code in any form, fork the repository and clone it locally. Create a new branch for your feature:
git commit -b feature/whatever-you-like
Then make sure all the tests past (and write new ones for any new features):
pip install -e . pip install -r requirements-dev.txt django-admin.py test --settings=test.settings
Check if the README.rst looks right:
restview --long-description
Then push the finished feature to github and open a pull request form the branch.
New Release
To create a new release:
Add changes to CHANGES.txt
Change version in setup.py
python setup.py register
python setup.py sdist upload
Metadata
Release files for django-response-timeout 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-response-timeout-0.1.0.tar.gz | 4.4 kB | Without provenance | Details |
Release files / django-response-timeout-0.1.0.tar.gz
| Download URL | django-response-timeout-0.1.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6632bb82e101404c2ff4ab27c6d353d01f9dda6e2e5e0395d61289b6fab33761
|
|
BLAKE2b-256 checksum How to use checksums |
b81edaea4d67aa52b5e0a6a8ba359f70127b3a9b779ace93418b2ba563568a61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-response-timeout 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.