Conjunto 90a50de en sapic


Ignorar:
Fecha y hora:
17/08/2017 14:48:33 (hace 7 años)
Autor:
Erwin Paredes <eparedes@…>
Branches:
master, erwin, explicacion_situacional, gestion_usuarios, taller_django
Children:
062ee25
Parents:
9b2d259
Mensaje:

avance en presentacion curso django

Ubicación:
curso_django
Ficheros:
6 editados

Leyenda

No modificado
Añadido
Eliminado
  • curso_django/curso_django.aux

    rfa1fdaf r90a50de  
    143143\@writefile{nav}{\headcommand {\slideentry {2}{15}{1}{36/36}{Crear Login}{0}}}
    144144\@writefile{nav}{\headcommand {\beamer@framepages {36}{36}}}
    145 \@writefile{toc}{\beamer@subsectionintoc {2}{16}{Registro de Usuarios}{37}{0}{2}}
    146 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{16}{37}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {36}{36}}}
    147 \@writefile{nav}{\headcommand {\slideentry {2}{16}{1}{37/37}{Registro de Usuarios}{0}}}
     145\@writefile{nav}{\headcommand {\slideentry {2}{15}{2}{37/37}{Crear Login}{0}}}
    148146\@writefile{nav}{\headcommand {\beamer@framepages {37}{37}}}
    149 \@writefile{toc}{\beamer@subsectionintoc {2}{17}{Login required}{38}{0}{2}}
    150 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{17}{38}{Login required}}\headcommand {\beamer@subsectionpages {37}{37}}}
    151 \@writefile{nav}{\headcommand {\slideentry {2}{17}{1}{38/38}{Login required}{0}}}
     147\@writefile{toc}{\beamer@subsectionintoc {2}{16}{Registro de Usuarios}{38}{0}{2}}
     148\@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{16}{38}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {36}{37}}}
     149\@writefile{nav}{\headcommand {\slideentry {2}{16}{1}{38/38}{Registro de Usuarios}{0}}}
    152150\@writefile{nav}{\headcommand {\beamer@framepages {38}{38}}}
    153 \@writefile{toc}{\beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{39}{0}{2}}
    154 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{18}{39}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {38}{38}}}
    155 \@writefile{nav}{\headcommand {\slideentry {2}{18}{1}{39/39}{Recuperar contrase\IeC {\~n}a por correo}{0}}}
     151\@writefile{toc}{\beamer@subsectionintoc {2}{17}{Login required}{39}{0}{2}}
     152\@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{17}{39}{Login required}}\headcommand {\beamer@subsectionpages {38}{38}}}
     153\@writefile{nav}{\headcommand {\slideentry {2}{17}{1}{39/39}{Login required}{0}}}
    156154\@writefile{nav}{\headcommand {\beamer@framepages {39}{39}}}
    157 \@writefile{toc}{\beamer@subsectionintoc {2}{19}{Conceptos avanzados}{40}{0}{2}}
    158 \@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{19}{40}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {39}{39}}}
    159 \@writefile{nav}{\headcommand {\slideentry {2}{19}{1}{40/40}{Conceptos avanzados}{0}}}
     155\@writefile{toc}{\beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{40}{0}{2}}
     156\@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{18}{40}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {39}{39}}}
     157\@writefile{nav}{\headcommand {\slideentry {2}{18}{1}{40/40}{Recuperar contrase\IeC {\~n}a por correo}{0}}}
    160158\@writefile{nav}{\headcommand {\beamer@framepages {40}{40}}}
    161 \@writefile{nav}{\headcommand {\beamer@partpages {1}{40}}}
    162 \@writefile{nav}{\headcommand {\beamer@subsectionpages {40}{40}}}
    163 \@writefile{nav}{\headcommand {\beamer@sectionpages {6}{40}}}
    164 \@writefile{nav}{\headcommand {\beamer@documentpages {40}}}
    165 \@writefile{nav}{\headcommand {\def \inserttotalframenumber {40}}}
     159\@writefile{toc}{\beamer@subsectionintoc {2}{19}{Conceptos avanzados}{41}{0}{2}}
     160\@writefile{nav}{\headcommand {\beamer@subsectionentry {0}{2}{19}{41}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {40}{40}}}
     161\@writefile{nav}{\headcommand {\slideentry {2}{19}{1}{41/41}{Conceptos avanzados}{0}}}
     162\@writefile{nav}{\headcommand {\beamer@framepages {41}{41}}}
     163\@writefile{nav}{\headcommand {\beamer@partpages {1}{41}}}
     164\@writefile{nav}{\headcommand {\beamer@subsectionpages {41}{41}}}
     165\@writefile{nav}{\headcommand {\beamer@sectionpages {6}{41}}}
     166\@writefile{nav}{\headcommand {\beamer@documentpages {41}}}
     167\@writefile{nav}{\headcommand {\def \inserttotalframenumber {41}}}
  • curso_django/curso_django.nav

    rfa1fdaf r90a50de  
    9696\headcommand {\slideentry {2}{15}{1}{36/36}{Crear Login}{0}}
    9797\headcommand {\beamer@framepages {36}{36}}
    98 \headcommand {\beamer@subsectionentry {0}{2}{16}{37}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {36}{36}}
    99 \headcommand {\slideentry {2}{16}{1}{37/37}{Registro de Usuarios}{0}}
     98\headcommand {\slideentry {2}{15}{2}{37/37}{Crear Login}{0}}
    10099\headcommand {\beamer@framepages {37}{37}}
    101 \headcommand {\beamer@subsectionentry {0}{2}{17}{38}{Login required}}\headcommand {\beamer@subsectionpages {37}{37}}
    102 \headcommand {\slideentry {2}{17}{1}{38/38}{Login required}{0}}
     100\headcommand {\beamer@subsectionentry {0}{2}{16}{38}{Registro de Usuarios}}\headcommand {\beamer@subsectionpages {36}{37}}
     101\headcommand {\slideentry {2}{16}{1}{38/38}{Registro de Usuarios}{0}}
    103102\headcommand {\beamer@framepages {38}{38}}
    104 \headcommand {\beamer@subsectionentry {0}{2}{18}{39}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {38}{38}}
    105 \headcommand {\slideentry {2}{18}{1}{39/39}{Recuperar contrase\IeC {\~n}a por correo}{0}}
     103\headcommand {\beamer@subsectionentry {0}{2}{17}{39}{Login required}}\headcommand {\beamer@subsectionpages {38}{38}}
     104\headcommand {\slideentry {2}{17}{1}{39/39}{Login required}{0}}
    106105\headcommand {\beamer@framepages {39}{39}}
    107 \headcommand {\beamer@subsectionentry {0}{2}{19}{40}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {39}{39}}
    108 \headcommand {\slideentry {2}{19}{1}{40/40}{Conceptos avanzados}{0}}
     106\headcommand {\beamer@subsectionentry {0}{2}{18}{40}{Recuperar contrase\IeC {\~n}a por correo}}\headcommand {\beamer@subsectionpages {39}{39}}
     107\headcommand {\slideentry {2}{18}{1}{40/40}{Recuperar contrase\IeC {\~n}a por correo}{0}}
    109108\headcommand {\beamer@framepages {40}{40}}
    110 \headcommand {\beamer@partpages {1}{40}}
    111 \headcommand {\beamer@subsectionpages {40}{40}}
    112 \headcommand {\beamer@sectionpages {6}{40}}
    113 \headcommand {\beamer@documentpages {40}}
    114 \headcommand {\def \inserttotalframenumber {40}}
     109\headcommand {\beamer@subsectionentry {0}{2}{19}{41}{Conceptos avanzados}}\headcommand {\beamer@subsectionpages {40}{40}}
     110\headcommand {\slideentry {2}{19}{1}{41/41}{Conceptos avanzados}{0}}
     111\headcommand {\beamer@framepages {41}{41}}
     112\headcommand {\beamer@partpages {1}{41}}
     113\headcommand {\beamer@subsectionpages {41}{41}}
     114\headcommand {\beamer@sectionpages {6}{41}}
     115\headcommand {\beamer@documentpages {41}}
     116\headcommand {\def \inserttotalframenumber {41}}
  • curso_django/curso_django.out

    rfa1fdaf r90a50de  
    1919\BOOKMARK [3][]{Outline0.2.14.35}{View's}{Outline0.2}% 19
    2020\BOOKMARK [3][]{Outline0.2.15.36}{Crear Login}{Outline0.2}% 20
    21 \BOOKMARK [3][]{Outline0.2.16.37}{Registro de Usuarios}{Outline0.2}% 21
    22 \BOOKMARK [3][]{Outline0.2.17.38}{Login required}{Outline0.2}% 22
    23 \BOOKMARK [3][]{Outline0.2.18.39}{Recuperar contrase\361a por correo}{Outline0.2}% 23
    24 \BOOKMARK [3][]{Outline0.2.19.40}{Conceptos avanzados}{Outline0.2}% 24
     21\BOOKMARK [3][]{Outline0.2.16.38}{Registro de Usuarios}{Outline0.2}% 21
     22\BOOKMARK [3][]{Outline0.2.17.39}{Login required}{Outline0.2}% 22
     23\BOOKMARK [3][]{Outline0.2.18.40}{Recuperar contrase\361a por correo}{Outline0.2}% 23
     24\BOOKMARK [3][]{Outline0.2.19.41}{Conceptos avanzados}{Outline0.2}% 24
  • curso_django/curso_django.tex

    rfa1fdaf r90a50de  
    730730\begin{frame}[fragile]
    731731\begin{verbatim}
    732 
     732Creamos la aplicacion user desde la consola:
     733
     734python manage.py startapp user
     735
     736Editamos el archivo user/views.py:
     737
     738# -*- coding: utf-8 -*-
     739
     740from django.shortcuts import render
     741from django.contrib import messages
     742from django.contrib.auth import (
     743    authenticate, logout, login
     744)
     745from django.contrib.auth.models import (
     746    Group, Permission, User
     747)
     748
     749class LoginView(FormView):
     750    form_class = FormularioLogin
     751    template_name = 'users.login.html'
     752    success_url = '/inicio/'
     753   
     754
     755\end{verbatim}
     756\end{frame}
     757
     758\begin{frame}[fragile]
     759\begin{verbatim}
     760def form_valid(self, form):
     761       
     762    usuario = form.cleaned_data['usuario']
     763    contrasena = form.cleaned_data['contrasena']
     764    usuario = authenticate(username=usuario,password=contrasena)
     765       
     766    if usuario is not None:
     767        login(self.request, usuario)
     768        messages.info(self.request,'Bienvenido %s has ingresado\
     769                                    Sistema con el usuario %s \
     770                                    ' % (usuario.first_name,
     771                                         usuario.username))
     772    else:
     773        self.success_url = reverse_lazy('users:login')
     774        messages.warning(self.request,'Verifique su nombre y \
     775                                       contraseña\
     776                                      y vuelve a intertar')
     777
     778    return super(LoginView, self).form_valid(form)
     779 
    733780\end{verbatim}
    734781\end{frame}
  • curso_django/curso_django.toc

    rfa1fdaf r90a50de  
    2121\beamer@subsectionintoc {2}{14}{View's}{35}{0}{2}
    2222\beamer@subsectionintoc {2}{15}{Crear Login}{36}{0}{2}
    23 \beamer@subsectionintoc {2}{16}{Registro de Usuarios}{37}{0}{2}
    24 \beamer@subsectionintoc {2}{17}{Login required}{38}{0}{2}
    25 \beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{39}{0}{2}
    26 \beamer@subsectionintoc {2}{19}{Conceptos avanzados}{40}{0}{2}
     23\beamer@subsectionintoc {2}{16}{Registro de Usuarios}{38}{0}{2}
     24\beamer@subsectionintoc {2}{17}{Login required}{39}{0}{2}
     25\beamer@subsectionintoc {2}{18}{Recuperar contrase\IeC {\~n}a por correo}{40}{0}{2}
     26\beamer@subsectionintoc {2}{19}{Conceptos avanzados}{41}{0}{2}
Nota: Vea TracChangeset para ayuda en el uso del visor de conjuntos de cambios.