
    q$h	                         S SK JrJr  S SKJrJrJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  S rS rS	 rS
 rS rS rS rS rS rS rS rS rS rS rS rg)    )renderredirect)authenticateloginlogout)AuthenticationForm)csrf_exempt)messages)Userc                     [        S5      $ Nr   )r   requests    BC:\Repositorios\Repos en GIT\Fox\app\controllers\authController.pyaccountsloginr      s    G    c                    SnSnU R                   S:X  a  U R                  S   nU R                  S   n [        R                  R	                  US9n[        XR                  US	9nUb  [        X5        [        S
5      $ [        R                  " U S5        [        U SXS.5      $ ! [        R
                   a)    [        R                  " U S5        [        U SXS.5      s $ f = f)N POSTemailpassword)r   u   Email o contraseña incorrectosz
login.html)r   r   )usernamer   home)methodr   r   objectsgetDoesNotExistr
   errorr   r   r   r   r   )r   r   r   users       r   
login_viewr       s    EH~~W%<<
+	Y<<##%#0D
 GmmhO' F##NN7$EF'<5)OPP    	YNN7$EF'<51WXX	Ys   B$ $:C! C!c                 .    [        U 5        [        S5      $ r   )r   r   r   s    r   logout_viewr"   $   s    
7OGr   c                     [        U S5      $ )Nzdashboardcrm.htmlr   r   s    r   viewdashboardcrmr%   *       './/r   c                     [        U S5      $ )Nzdashboardecommerce.htmlr$   r   s    r   viewdashboardecommercer(   -       '455r   c                     [        U S5      $ )Nzdashboardcrypto.htmlr$   r   s    r   viewdashboardcryptor+   0       '122r   c                     [        U S5      $ )Nzdashboardjobs.htmlr$   r   s    r   viewdashboardjobsr.   3   s    '/00r   c                     [        U S5      $ )Nzdashboardnft.htmlr$   r   s    r   viewdashboardnftr0   6   r&   r   c                     [        U S5      $ )Nzdashboardsales.htmlr$   r   s    r   viewdashboardsalesr2   9   s    '011r   c                     [        U S5      $ )Nzdashboardanalytics.htmlr$   r   s    r   viewdashboardanalyticsr4   <   r)   r   c                     [        U S5      $ )Nzdashboardprojects.htmlr$   r   s    r   viewdashboardprojectsr6   ?       '344r   c                     [        U S5      $ )Nzdashboardhrm.htmlr$   r   s    r   viewdashboardhrmr9   B   r&   r   c                     [        U S5      $ )Nzdashboardstocks.htmlr$   r   s    r   viewdashboardstocksr;   E   r,   r   c                     [        U S5      $ )Nzdashboardcourses.htmlr$   r   s    r   viewdashboardcoursesr=   H   s    '233r   c                     [        U S5      $ )Nzdashboardpersonal.htmlr$   r   s    r   viewdashboardpersonalr?   K   r7   r   N)django.shortcutsr   r   django.contrib.authr   r   r   django.contrib.auth.formsr   django.views.decorators.csrfr	   django.contribr
   django.contrib.auth.modelsr   r   r    r"   r%   r(   r+   r.   r0   r2   r4   r6   r9   r;   r=   r?    r   r   <module>rG      sf    - ; ; 8 4 # +
Q,063102650345r   