Пример #1
0
    def test_encrypt_verify(self):
        test_passwd = 'test_password_1234'

        cipher = Auth.encrypt_passwd(test_passwd)

        self.assertTrue(Auth.verify_passwd(test_passwd, cipher))
        self.assertFalse(Auth.verify_passwd('test_password_123', cipher))
while True:
    pw = getpass('Password: '******'No password entered, exiting')
        exit()

    cf = getpass('Confirm')

    if pw != cf:
        print('Passwords do not match, please try again')
        continue

    #try:
    cipher = Auth.encrypt_passwd(pw)
    #except:
    #    print('Invalid password format, please choose a different password')
    #    continue

    break

if cipher is None:
    print('Failed, please try again')
    exit()

print('Do NOT store this in config.py')
print('Store this in admin_webapp/instance/config.py')
print('Restart after ensuring you have the following lines:\n')
print('ADMIN_USERNAME = "******"')
print('ADMIN_PASSWORD = "******"')