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

session_security does not properly support django 4 - uses deprecated django.conf.urls lib #155

Closed RustyTaint666 closed 9 months ago

RustyTaint666 commented 9 months ago

I recently upgraded a project to django 4.2, and now I am running into an import error in the session_security project. Here is the import error: session_security\urls.py", line 18, in from django.conf.urls import url ImportError: cannot import name 'url' from 'django.conf.urls'

django.conf.urls has been deprecated and removed in django 4. Is there any way around this currently or is a code change required?

mpasternak commented 9 months ago

Patches accepted

mpasternak commented 9 months ago

But it looks like you’re using an old version of the package

RustyTaint666 commented 9 months ago

The problematic import exists here: venv/Lib/site-packages/session_security/urls.py

RustyTaint666 commented 9 months ago

I think that this file needs to be updated to support django 4: https://github.com/yourlabs/django-session-security/blob/master/session_security/urls.py

RustyTaint666 commented 9 months ago

never mind. I think I see the correct import on master. weird. I have this version 2.6.7 installed

RustyTaint666 commented 9 months ago

maybe something cached old lib. I will check. thank you for the quick response

RustyTaint666 commented 9 months ago

yep. old lib was cached. my bad lol. thank you for the help.