rsession
rsession is yet another Redis-backed Django session store.
There are a few available within a short Google but it was not clear which should be used and differences between them made me decide to roll my own.
This session store is a copy of Django’s own database session store with each method modified to suit Redis.
Installation of rsession is easily accomplished with pip:
$ pip install rsession
To use, install Redis and amend your Django settings as follows, substituting appropriate values if your Redis server is not a default installation on localhost:
RSESSION = {
'HOST' : 'localhost',
'PORT' : 6379,
'DB' : 0,
'PASSWORD' : '',
'PREFIX' : 'RSESSION',
}
SESSION_ENGINE = "rsession.rsession"
# 14 days is default expiry for Django. Setting included
# here to remind the user that the session length is modifiable
# and probably should be for your application
SESSION_COOKIE_AGE = 60 * 60 * 24 * 14 # 14 days in seconds
SESSION_SAVE_EVERY_REQUEST = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
Finally, whilst not essential, you can remove django.contrib.sessions from your installed apps as this is only required if using Django database-backed sessions.
Your work is now done. Django sessions will be stored in Redis under the key RSESSION:<session key> (unless you change the prefix in settings as above) and these will be purged SESSION_COOKIE_AGE seconds after the last use.
If you have comments and would like to get in touch, please mail rsession at zorinholdings.com
Matthew May 2011
Metadata
Release files for rsession 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 | |
|---|---|---|---|---|
| rsession-0.1.0.tar.gz | 2.8 kB | Without provenance | Details |
Release files / rsession-0.1.0.tar.gz
| Download URL | rsession-0.1.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
700a31bcf11c7e6f7839b6198cca09a4e959e65309b8b62bb28ef4f97873f42d
|
|
BLAKE2b-256 checksum How to use checksums |
8105f38df1ffd766453c53132361cb8e6b32d5d2207a132cd47c397f6c386e46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rsession 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.