Fixed initial DB creation
This commit is contained in:
parent
322d9992fc
commit
497ae8973e
@ -26,9 +26,6 @@ with app.app_context():
|
||||
app.iniconfig.read(config_path)
|
||||
# Build a sample db on the fly, if one does not exist yet.
|
||||
app_dir = os.path.realpath(os.path.dirname(__file__))
|
||||
database_path = os.path.join(app_dir, app.config['DATABASE_FILE'])
|
||||
if not os.path.exists(database_path):
|
||||
build_sample_db()
|
||||
|
||||
print app.config["SECURITY_POST_LOGIN_VIEW"]
|
||||
# Define models
|
||||
@ -198,6 +195,9 @@ videoadmin = VideoAdmin()
|
||||
admin.add_view(videoadmin)
|
||||
|
||||
if __name__ == '__main__':
|
||||
database_path = os.path.join(app_dir, app.config['DATABASE_FILE'])
|
||||
if not os.path.exists(database_path):
|
||||
build_sample_db()
|
||||
app.run(host=app.config.get("HOST", "localhost"),
|
||||
port=app.config.get("PORT", 5000),
|
||||
debug=True)
|
||||
|
Loading…
Reference in New Issue
Block a user