Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask tutorial:
#2
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.')
Reply


Messages In This Thread
Flask tutorial: - by kintarowonders - Mar-22-2019, 11:36 PM
RE: Flask tutorial: - by nilamo - Mar-27-2019, 07:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask tutorial errors in jinja, auth undefined Ecniv 2 2,591 May-03-2019, 02:04 PM
Last Post: Ecniv

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020