> 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

[![](/files/-MfuAP0TTmVUwSHDjaRn)](https://youtu.be/SPnFqVRAows)

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

![](/files/5yQAAuqmpHdOp0r1qaxa)

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>
```
