def write_users(dburl):
    """Write users to the DB."""
    data = {
        'username': 'admin',
        'realname': 'Website Administrator',
        'email': 'coil@example.com',
        'password':
            r'$bcrypt-sha256$2a,12$NNtd2TC9mZO6.EvLwEwlLO$axojD34/iE8x'
            r'QitQnCCOGPhofgmjNdq',
    }

    for p in PERMISSIONS:
        data[p] = '1'

    db = redis.StrictRedis.from_url(dburl)
    db.hmset('user:1', data)
    db.hset('users', 'admin', '1')
    if not db.exists('last_uid'):
        db.incr('last_uid')

    print("Username: admin")
    print("Password: admin")
    return 0
Write users to the DB.