U
    	N_                     @   s\   d dl mZmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
mZ d dlmZ dd Zd	S )
    )renderredirect)User)	LoginView)HttpResponse)authenticatelogin)ConnexionFormc                 C   s   d}| j }|jrtdS | jdkrzt| j}| r|jd }|jd }t||d}|rtt	| | t| j
ddS d	}nt }t| d
t S )NFhomePOSTusernamepassword)r   r   nextz/accounts/profile/Tzaccounts/login.html)useris_authenticatedr   methodr	   r   is_validcleaned_datar   r   getr   locals)requesterrorr   formr   r    r   )/var/www/html/iltdigicom/account/views.py
login_view
   s     




r   N)django.shortcutsr   r   django.contrib.auth.modelsr   django.contrib.auth.viewsr   django.httpr   django.contrib.authr   r   Zaccount.formsr	   r   r   r   r   r   <module>   s   