Logout Logout from Django Sadjcore Utilities to log out from a SmartAdmin for Django application

You are not logged in

You are not currently logged in via the Django authentication system, please login to access more functionality.

Logout Integration

Logout is via a popup, which can be invoked via data-toggle and data-target attributes on a suitable control element:

<a href="#" class="header-icon" data-toggle="modal" data-target="#logout-modal-alert"><i class="fal fa-sign-out-alt"></i></a>

The logout popup and associated code are included by this line in the demoframe template:

{% include 'sadjcore/fragments/logoutpopup.html' %}

When accessing these pages via the sadjdemo app, there is a logout icon in the demoframe.html template, which displays whenever the user is logged in.

Sadjdemo application logout popup

The 'Logout' button on the popup redirects to the Django admin logout function using a sadjcore method which is invoked by the sadj-action attribute on the button element:

sadj-action="redirect" data-url="/demo/logout" data-dismiss="modal"

The Django view is then configured to redirect back to the login page by the entry in sadjdemo.urls:

path('logout/', auth_views.LogoutView.as_view(next_page=f'/{url_prefix}/login'), name='logout')