forked from orbit-oss/flask
with_appcontext lasts for the lifetime of the click context
This commit is contained in:
parent
ae547270e9
commit
c9e000b9ce
6 changed files with 65 additions and 26 deletions
|
|
@ -3,7 +3,6 @@ import sqlite3
|
|||
import click
|
||||
from flask import current_app
|
||||
from flask import g
|
||||
from flask.cli import with_appcontext
|
||||
|
||||
|
||||
def get_db():
|
||||
|
|
@ -39,7 +38,6 @@ def init_db():
|
|||
|
||||
|
||||
@click.command("init-db")
|
||||
@with_appcontext
|
||||
def init_db_command():
|
||||
"""Clear existing data and create new tables."""
|
||||
init_db()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue