A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Bouke/django-user-sessions below:

jazzband/django-user-sessions: Extend Django sessions with a foreign key back to the user, allowing enumerating all user's sessions.

Django includes excellent built-in sessions, however all the data is hidden away into base64 encoded data. This makes it very difficult to run a query on all active sessions for a particular user. django-user-sessions fixes this and makes session objects a first class citizen like other ORM objects. It is a drop-in replacement for django.contrib.sessions.

I would love to hear your feedback on this package. If you run into problems, please file an issue on GitHub, or contribute to the project by forking the repository and sending some pull requests. The package is translated into English, Dutch and other languages. Please contribute your own language using Transifex.

Also have a look at the bundled example templates and views to see how you can integrate the application into your project.

Compatible with Django 3.2 and 4.2 on Python 3.8 to 3.11. Documentation is available at readthedocs.org.

To get the list of a user's sessions:

user.session_set.filter(expire_date__gt=now())

Or logout the user everywhere:

user.session_set.all().delete()

The user's IP address and user agent are also stored on the session. This allows to show a list of active sessions to the user in the admin:

And also in a custom layout:

Refer to the installation instructions in the documentation.

You need to setup GeoIP for the location detection to work. See the Django documentation on installing GeoIP.

For general questions regarding this package, please hop over to Stack Overflow. If you think there is an issue with this package; check if the issue is already listed (either open or closed), and file an issue if it's not.

This project aims for full code-coverage, this means that your code should be well-tested. Also test branches for hardened code. You can run the full test suite with:

make test

Or run a specific test with:

make test TARGET=tests.tests.MiddlewareTest

For Python compatibility, tox is used. You can run the full test suite with:

tox

The following actions are required to push a new version:

This project is licensed under the MIT license.

This library was written by Bouke Haarsma and contributors.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4