#NEWLINE# def send_temporary_password( self ) : #NEWLINE# #INDENT# password = User . objects . make_random_password ( ) #NEWLINE# self . set_password ( password ) #NEWLINE# ( subject , from_email , to ) = ( 'OpenCloud Account Credentials' , 'support@opencloud.us' , str ( self . email ) ) #NEWLINE# text_content = 'This is an important message.' #NEWLINE# userUrl = ( 'http://%s/' % get_request ( ) . get_host ( ) ) #NEWLINE# html_content = ( ( ( ( ( ( '<p>Your account has been created on OpenCloud. Please log in <a href=' + userUrl ) + '>here</a> to activate your account<br><br>Username: ' ) + self . email ) + '<br>Temporary Password: ' ) + password ) + '<br>Please change your password once you successully login into the site.</p>' ) #NEWLINE# msg = EmailMultiAlternatives ( subject , text_content , subject , [ to ] ) #NEWLINE# msg . attach_alternative ( html_content , 'text/html' ) #NEWLINE# msg . send ( )