Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Introduction

utsessions allow the features of timed and unique sessions for an user account in Django.

What does it do ?

utsessions is a middleware that makes all opened user sessions unique.

When an user session is opened, the user account can’t be reused before a certain amount of time. After this time, if the user account is reused, the first session is closed and a second one is opened.

A session can also be automaticaly closed after a choosen time.

This kind of behavior is useful for websites providing access to data by unique user account.

Philosophy

utsessions was written to be easily :

  • Installed in your projects, by simply registering the middleware.

  • Extended thanks to his design in object: each component can be removed or reused.

  • Configured, with the settings.py file which allows different behaviors.

Installation

Download the latest packaged version at http://code.google.com/p/django-ut-sessions/ and unpack it.

You can also perform a Subversion checkout to get the latest code.

svn checkout http://django-ut-sessions.googlecode.com/svn/trunk/ django-ut-sessions

Inside the package use this command line to install the package into your PYTHONPATH.

$> python setup.py install

Project installation

Now simply add this following line into your MIDDLEWARE_CLASSES section.

utsessions.middleware.UTSessionMiddleware

It must be after the SessionMiddleware and AuthentifcationMiddleware like this :

MIDDLEWARE_CLASSES = (
  'django.middleware.common.CommonMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'utsessions.middleware.UTSessionMiddleware',
)

Settings

If you want to define the period of a session before being logged out, set a value in seconds to SESSION_LIMIT_SECONDS in your settings.py

A session can be released for another user before a certain amount of time, set to default at 300 seconds. To change this value define SESSION_TOKEN_LIMIT_SECONDS. If set to 0, no lock will be created.

Tests

Put utsessions into your INSTALLED_APPS section and run :

$> python manage.py test utsessions

Metadata

Release files for utsessions 0.2dev-r6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for utsessions 0.2dev-r6
File Size Uploaded
utsessions-0.2dev-r6.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for utsessions 0.2dev-r6
File Interpreter ABI Platform
utsessions-0.2dev_r6-py2.4.egg Legacy Egg format - - Details

Total release size: 13.2 kB

Release files / utsessions-0.2dev-r6.tar.gz

Download URL utsessions-0.2dev-r6.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
05376d19a5ada5847a42a9b03359d29b432f52d858be5b269365f0a46a9006f0
BLAKE2b-256 checksum
How to use checksums
0e00f0834a2760801d4643fd9c7d0c1abee87919d48c4cd9f6632fddf3c65437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / utsessions-0.2dev_r6-py2.4.egg

Download URL utsessions-0.2dev_r6-py2.4.egg
Size 9.2 kB
Tags Egg
SHA-256 checksum
How to use checksums
869da09e603f13aa5ff4baf6934a03872c8258a14bebfae4b625ef8020f73fe1
BLAKE2b-256 checksum
How to use checksums
54cfdbce6c77ab73179e788299988dda6ba31181ea6c698add1f2fd447b9a822
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2dev-r6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page