Horje
django session expire time Code Example
django session expire time
I use Django 2.1.7 and the easiest way to expire django session is:

first you need to install django-session-timeout with command:

pip install django-session-timeout

then you need to update your SessionTimeoutMiddleware in settings.py

MIDDLEWARE_CLASSES = [
     ...
    'django.contrib.sessions.middleware.SessionMiddleware',
 #add below middleware 
    'django_session_timeout.middleware.SessionTimeoutMiddleware',
     ...
]

at last you need to add SESSION_EXPIRE_SECONDS at the end of settings.py:

SESSION_EXPIRE_SECONDS = 300  # 300 seconds = 5 minutes

By default, the session will expire X seconds after the start of the session. To expire the session X seconds after the last activity, use the following setting:

SESSION_EXPIRE_AFTER_LAST_ACTIVITY = True




Python

Related
pandas groupby count occurrences Code Example pandas groupby count occurrences Code Example
python sympy solve equation equal to 0 Code Example python sympy solve equation equal to 0 Code Example
maximizar ventana tkinter python Code Example maximizar ventana tkinter python Code Example
python create map with coordinates Code Example python create map with coordinates Code Example
pandas read csv no index Code Example pandas read csv no index Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7