django-session-user
===================
This app is a simple piece of middleware that can be added to your Django
project which will store and retrieve the logged-in user's information from
the session.
Installation
------------
Add the sesionuser middleware line to your MIDDLEWARE_CLASSES after the
AuthenticationMiddleware:
MIDDLEWARE_CLASSES = (
# ...
'django.contrib.auth.middleware.AuthenticationMiddleware',
'sessionuser.middleware.SessionUserMiddleware',
# ...
)
Why do this?
------------
Your server is already fetching the contents of the user's session, which
already contains the user's identity. Why not store the rest of the user
class's data along with it? That way you don't have to make a request to the
database for every authenticated web request.
Additionally if you are using a cookie-based session backend (like
django-cookie-sessions, written by yours truly) you can have other systems,
maybe even non-Django systems, which read the cookie and know more information
about the user.
Customizable Settings
---------------------
COOKIE_USER_REFRESH_TIME [= 14400]:
The number of seconds that need to elapse before the user is fetched from
the database instead of trusting the cookie. This is useful for making
sure that even if the user's properties are changed in the database,
the user's cookie will still be updated.
Metadata
Release files for django-session-user 0.1.1
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 | Actions |
|---|---|---|---|---|
| django-session-user-0.1.1.tar.gz | 3.8 kB | Without provenance | Details for django-session-user-0.1.1.tar.gz |
Release files / django-session-user-0.1.1.tar.gz
| Download URL | django-session-user-0.1.1.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a80293ba698dcd2305b33fa92fc74de7a84ee8a0e7c978f9ef125da2441ad290
|
|
BLAKE2b-256 checksum How to use checksums |
55bb9a9b6cae355877ee34be0068a2a859e1b5eabe2acc113939b40f51baebcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-session-user 0.1.1
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.