Skip to content

Commit

Permalink
Enable configurable root URL paths
Browse files Browse the repository at this point in the history
  • Loading branch information
blag committed Sep 18, 2023
1 parent 322c88b commit 39569b1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion example/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]

Expand Down
2 changes: 1 addition & 1 deletion tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
]
6 changes: 3 additions & 3 deletions user_sessions/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
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',
),
re_path(
r'^account/sessions/(?P<pk>\w+)/delete/$',
r'sessions/(?P<pk>\w+)/delete/$',
view=SessionDeleteView.as_view(),
name='session_delete',
),
Expand Down

0 comments on commit 39569b1

Please sign in to comment.