@click.command(u'set-admin-password')
@click.argument(u'admin-password')
@pass_context
def set_admin_password(context, admin_password):
 import getpass
 from frappe.utils.password import update_password
 for site in context.sites:
  try:
   frappe.init(site=site)
   while (not admin_password):
    admin_password = getpass.getpass(u"Administrator's password for {0}: ".format(site))
   frappe.connect()
   update_password(u'Administrator', admin_password)
   frappe.db.commit()
   admin_password = None
  finally:
   frappe.destroy()

@ click . command ( u'set-admin-password' ) @ click . argument ( u'admin-password' ) @ pass_context def set_admin_password ( context , admin_password ) : import getpass from frappe . utils . password import update_password for site in context . sites : try : frappe . init ( site = site ) while ( not admin_password ) : admin_password = getpass . getpass ( u"Administrator's password for {0}: " . format ( site ) ) frappe . connect ( ) update_password ( u'Administrator' , admin_password ) frappe . db . commit ( ) admin_password = None finally : frappe . destroy ( )
set administrator password for a site .