Mar-27-2019, 07:37 PM
Is this the tutorial you followed? I don't see the typo...
http://flask.pocoo.org/docs/1.0/tutorial/database/#id3 Wrote:def init_db(): db = get_db() with current_app.open_resource('schema.sql') as f: db.executescript(f.read().decode('utf8')) @click.command('init-db') @with_appcontext def init_db_command(): """Clear the existing data and create new tables.""" init_db() click.echo('Initialized the database.')