From 7538ae0b3798b0c1a2506cd2be5e71c3e72cee75 Mon Sep 17 00:00:00 2001 From: blag Date: Mon, 18 Sep 2023 13:30:37 -0700 Subject: [PATCH] Enable configurable root URL paths --- docs/installation.rst | 2 +- example/urls.py | 2 +- tests/urls.py | 2 +- user_sessions/urls.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 48b9725..ce81ee1 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -7,7 +7,7 @@ Installation ``'django.contrib.sessions.middleware.SessionMiddleware'`` with ``'user_sessions.middleware.SessionMiddleware'``. 4. Add ``SESSION_ENGINE = 'user_sessions.backends.db'``. -5. Add ``url(r'', include('user_sessions.urls', 'user_sessions')),`` to your +5. Add ``url('account/', include('user_sessions.urls', 'user_sessions')),`` to your ``urls.py``. 6. Make sure ``LOGOUT_REDIRECT_URL`` is set to some page to redirect users after logging out. diff --git a/example/urls.py b/example/urls.py index cad7aa4..35f5ea2 100644 --- a/example/urls.py +++ b/example/urls.py @@ -14,7 +14,7 @@ ), name='home', ), - re_path(r'', include('user_sessions.urls', namespace='user_sessions')), + re_path(r'account/', include('user_sessions.urls', namespace='user_sessions')), re_path(r'^admin/', admin.site.urls), ] diff --git a/tests/urls.py b/tests/urls.py index 51a12fc..3d1ce35 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -18,5 +18,5 @@ def modify_session(request): path('', empty), path('modify_session/', modify_session), path('admin/', admin.site.urls), - path('', include('user_sessions.urls', namespace='user_sessions')), + path('account/', include('user_sessions.urls', namespace='user_sessions')), ] diff --git a/user_sessions/urls.py b/user_sessions/urls.py index 5536b73..b814901 100644 --- a/user_sessions/urls.py +++ b/user_sessions/urls.py @@ -5,12 +5,12 @@ app_name = 'user_sessions' urlpatterns = [ path( - 'account/sessions/', + 'sessions/', view=SessionListView.as_view(), name='session_list', ), path( - 'account/sessions/other/delete/', + 'sessions/other/delete/', view=SessionDeleteOtherView.as_view(), name='session_delete_other', ),