Giter Site home page Giter Site logo

savoirfairelinux / django-session-idle-timeout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tzulberti/django-session-idle-timeout

0.0 6.0 0.0 16 KB

A Django middleware application to timeout a logged in user session after a specified time period

Home Page: django-session-idle-timeout

Python 89.17% HTML 10.83%

django-session-idle-timeout's Introduction

django-session-idle-timeout

A Django middleware application to timeout a logged in user session after a specified time period. A django message will be issued if the session gets timed out.

Requirements

Make sure the following Django apps and middlewares are enabled:

INSTALLED_APPS += (
    'django.contrib.auth',
    'django.contrib.sessions',
    'django.contrib.messages',
)
MIDDLEWARE_CLASSES += (
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

Installation instructions

Install django-session-idle-timeout

easy_install django-session-idle-timeout

or

pip install django-session-idle-timeout

Installed apps

INSTALLED_APPS += (
    'django-session-idle-timeout',
)

Middleware

MIDDLEWARE_CLASSES += (
    'django-session-idle-timeout.middleware.SessionIdleTimeout',
)

Settings

SESSION_IDLE_TIMEOUT defines the period after which the session gets timed out in seconds. The default value is 30min.

SESSION_IDLE_TIMEOUT = 1800

Keepalive Ping

Keeps the session alive as long as the browser window is opened using a javascript ping.

Urls

Add to your urls.py e.g.:

urlpatterns += (
    url(r'^django-session-idle-timeout/', include('django-session-idle-timeout.urls')),
)

Template

Load the keepalive template tag to start the javascript polling:

{% session_keep_alive %}
{% load session_keep_alive %}

Important

This is a fork of http://github.com/subhranath/django-session-idle-timeout

django-session-idle-timeout's People

Contributors

tzulberti avatar lociii avatar maestrofjp avatar subhranath avatar cbluoss avatar

Watchers

Emmanuel Milou avatar Anton Samarchyan avatar James Cloos avatar Ernesto Rodriguez Ortiz avatar Souleymane Sow avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.