Ejemplo n.º 1
0
 def set_password(self, password):
     self.pw_hash = gen_pwhash(password)
Ejemplo n.º 2
0
        from rezine.upgrades import REPOSITORY_PATH
        from rezine.upgrades.customisation import Repository

        repo = Repository(REPOSITORY_PATH, "Rezine")
        e.execute(
            schema_versions.insert(),
            repository_id=repo.config.get("repository_id"),
            repository_path=repo.path,
            version=int(repo.latest),
        )

        # create admin account
        user_id = e.execute(
            users.insert(),
            username=admin_username,
            pw_hash=gen_pwhash(admin_password),
            email=admin_email,
            real_name=u"",
            description=u"",
            extra={},
            display_name="$username",
            is_author=True,
        ).inserted_primary_key[0]

        # insert a privilege for the user
        privilege_id = e.execute(privileges.insert(), name=BLOG_ADMIN.name).inserted_primary_key[0]
        e.execute(user_privileges.insert(), user_id=user_id, privilege_id=privilege_id)


def main():
    from werkzeug import script
Ejemplo n.º 3
0
 def set_password(self, password):
     self.pw_hash = gen_pwhash(password)