
    df                     V    d dl Z d dlmZmZmZ d dlmZ d dlmZ  G d de          Z	dS )    N)mail_adminsmail_managers	send_mail)BaseCommand)timezonec                   "    e Zd ZdZdZd Zd ZdS )CommandzASends a test email to the email addresses specified as arguments.zRYou must specify some email recipients, or pass the --managers or --admin options.c                     |                     ddd           |                     ddd           |                     d	dd
           d S )Nemail*z4One or more email addresses to send a test email to.)nargshelpz
--managers
store_truezBSend a test email to the addresses specified in settings.MANAGERS.)actionr   z--adminsz@Send a test email to the addresses specified in settings.ADMINS.)add_argument)selfparsers     iD:\Python Project\djangoTemplates\venv\Lib\site-packages\django/core/management/commands/sendtestemail.pyadd_argumentszCommand.add_arguments   s    G 	 	
 	
 	

 	U 	 	
 	
 	

 	S 	 	
 	
 	
 	
 	
    c                     dt          j                    dt          j                    }t	          |dd |d                    |d         rt          |d           |d         rt          |d	           d S d S )
NzTest email from z on z*If you're reading this, it was successful.r   )subjectmessage
from_emailrecipient_listmanagersz)This email was sent to the site managers.adminsz'This email was sent to the site admins.)socketgethostnamer   nowr   r   r   )r   argskwargsr   s       r   handlezCommand.handle    s     060B0D0D0D0DhlnnnU@!'?		
 	
 	
 	
 * 	P'#NOOO( 	L!JKKKKK	L 	Lr   N)__name__
__module____qualname__r   missing_args_messager   r#    r   r   r	   r	      sF        ND	 

 
 
"L L L L Lr   r	   )
r   django.core.mailr   r   r   django.core.management.baser   django.utilsr   r	   r(   r   r   <module>r,      s     B B B B B B B B B B 3 3 3 3 3 3 ! ! ! ! ! !&L &L &L &L &Lk &L &L &L &L &Lr   