(username)
Register a new user.
Register a new user.
Register a new user .
def adduser(username):
    """Register a new user."""
    from getpass import getpass
    password = getpass()
    password2 = getpass(prompt='Confirm: ')
    if password != password2:
        import sys
        sys.exit('Error: passwords do not match.')
    db.create_all()
    user = User(username=username, password=password)
    db.session.add(user)
    db.session.commit()
    print('User {0} was registered successfully.'.format(username))
def adduser ( username ) : from getpass import getpass password = getpass ( ) password2 = getpass ( prompt = 'Confirm: ' ) if password != password2 : import sys sys . exit ( 'Error: passwords do not match.' ) db . create_all ( ) user = User ( username = username , password = password ) db . session . add ( user ) db . session . commit ( ) print ( 'User {0} was registered successfully.' . format ( username ) )