yourlabs / django-session-security

A little javascript and middleware work together to ensure that the user was active during the past X minutes in any tab he has open. Otherwise, display a warning leaving a couple of minutes to show any kind of activity like moving the mouse. Otherwise, logout the user.
http://django-session-security.rtfd.org
MIT License
309 stars 142 forks source link

Django 2.1 & 2.2 compatibility? #125

Closed jhancia closed 5 months ago

jhancia commented 5 years ago

Is this package compatible with Django 2.1 & 2.2? Anyone using it in production? If so, we should add it to tox.ini and travis.yml

sillycube commented 5 years ago

Yes, I am using python 3.7, Django 2.2, jQuery 2.1.4. It works. But the documentation needs to be updated:

  1. settings.TEMPLATE_CONTEXT_PROCESSORS - 'django.core.context_processors.request' is replaced by 'django.template.context_processors.request' according to the documentation here.

  2. url(r'session_security/', include('session_security.urls')) is changed in django 2.2. Use path('session_security/', include('session_security.urls')),

mpasternak commented 5 years ago

Ping me in a pull request and I’ll review and merge. Thanks.

its4net commented 3 years ago

Not working for me in Django 2.2, any tips? I followed changes above. User get logged out after time regardless of activity and the popup warning never shows.

JanMalte commented 2 years ago

@its4net do you get any JavaScript errors in your browser debug console?

Did you included the session_security/all.html template?

And did you loaded jQuery in any way?

{# Load SessionSecurity javascript 'class', jquery should be loaded - by you - at this point #}
<script type="text/javascript" src="{% static 'session_security/script.js' %}"></script>