From c981db81e84e66ad9aff2ff1566d1132dbe28c66 Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Thu, 8 Aug 2024 09:17:58 +0200 Subject: [PATCH] Intentnado entrar y salir --- Libros/README.md | 1 + Libros/biblioteca/db.sqlite3 | Bin 147456 -> 147456 bytes .../templates/registration/logged_out.html | 7 +++++++ Libros/biblioteca/gestion/views.py | 6 ++++++ 4 files changed, 14 insertions(+) create mode 100644 Libros/README.md create mode 100644 Libros/biblioteca/gestion/templates/registration/logged_out.html diff --git a/Libros/README.md b/Libros/README.md new file mode 100644 index 0000000..2c57502 --- /dev/null +++ b/Libros/README.md @@ -0,0 +1 @@ +https://learndjango.com/tutorials/django-login-and-logout-tutorial \ No newline at end of file diff --git a/Libros/biblioteca/db.sqlite3 b/Libros/biblioteca/db.sqlite3 index f3582562d9a94c179819b36cffcf02b59c7b35a8..4aa591978f89e6aa36d18fec4d5ea0b95edd3488 100644 GIT binary patch delta 451 zcmajbPfwd*9KdmyaY=V5?!3*+>`e1}9^e6bLu8Z+ZMC&U62rhE|EiBdrP_<#d;|I> zyc-X`2ydQt=*d^IC7z8h;FE9iT`X#gMeXJbYu$d;S?m7S0jja?%Nh#&E4CFLM`yyWp$DPhjsX8ivv=Fmy9KFDc(GC)>RuHuG?t zOw?oKNI(pvb!LLy-BMKAPl;#kPsJlGH^eG#qB6W_L318%cg(i$oy%vXN2%t{u$>RG zO;@YD=?Gvq-y9w)67`dxGYnYdLE$m}4zKHQ127R}^od~@mRmC1^5OI8GuQaB;?&+d Y_G(@j?&ZJv%dLM~(Q0oO?%>1PKg-LBhyVZp delta 97 zcmZo@;B08%oFL8UHc`fz(QRWwY(Afvm9e3ffr*}lnWeF%N%QIa?Wgk@Ehn%s2rw}4 z-Pzc9g^!6*Wn-fP`o1al`qNCI@1113gyOAE4 diff --git a/Libros/biblioteca/gestion/templates/registration/logged_out.html b/Libros/biblioteca/gestion/templates/registration/logged_out.html new file mode 100644 index 0000000..61938f5 --- /dev/null +++ b/Libros/biblioteca/gestion/templates/registration/logged_out.html @@ -0,0 +1,7 @@ +{% block title %}Logged out{% endblock %} +{% block content %} + +Logged out +You have been successfully logged out. You can log-in again. + +{% endblock %} \ No newline at end of file diff --git a/Libros/biblioteca/gestion/views.py b/Libros/biblioteca/gestion/views.py index 45d20ce..8df04ba 100644 --- a/Libros/biblioteca/gestion/views.py +++ b/Libros/biblioteca/gestion/views.py @@ -84,3 +84,9 @@ def eliminar_libro(request, libro_id): libro = get_object_or_404(Libro, pk=libro_id) libro.delete() return redirect('lista_libros') + + +@login_required +def user_logout(request): + logout(request) + return render(request, 'registration/logged_out.html', {}) \ No newline at end of file