def register(): form = RegisterForm() if form.validate_on_submit(): # register if ok add_user(form.user) return redirect(url_for('web.index')) return render_template('register.html', form=form)
def reset_all(json_file): db.drop_all() db.create_all() items = json.loads(open(json_file).read()) for item in items['bookmarks']: i = ItemBookmark(**item) add_bookmark(i) for item in items['users']: i = User(**item) add_user(i)