> For the complete documentation index, see [llms.txt](https://www.dicas-de-django.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.dicas-de-django.com.br/076-16-logout.md).

# Dica 16 - Logout

[![](https://980509322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfu9nhT31FhtY3TMBTi%2Fuploads%2Fgit-blob-b3d2f4124239955eec7072e99d8d0f8ab8cac2b9%2Fyoutube.png?alt=media)](https://youtu.be/SPnFqVRAows)

**Importante:** remova a `\` no meio das tags.

![](https://980509322-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mfu9nhT31FhtY3TMBTi%2Fuploads%2Fgit-blob-c80bb8144ef90a579a7a4d4fd8bfb6a22340a07b%2Ftags.png?alt=media)

Edite `accounts/urls.py`

```python
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),  # noqa E501
    path('logout/', LogoutView.as_view(), name='logout'),  # noqa E501
]
```

Edite `core/templates/includes/nav.html`

```html
<span class="text-base font-normal text-gray-500 mr-5">Olá {{ request.user.first_name }}</span>
<a href="{\% url 'logout' %}" class="text-base font-normal text-gray-500 ml-5">Sair</a>
```
