Skip to content

Commit

Permalink
Remove Flask-Script manager from application.py
Browse files Browse the repository at this point in the history
With built in Flask CLI this is no longer needed.
  • Loading branch information
lfdebrux committed Oct 15, 2020
1 parent 17e6615 commit 3cd44fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
16 changes: 2 additions & 14 deletions application.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
#!/usr/bin/env python

from __future__ import print_function

import os

from dmutils import init_manager
from flask_migrate import Migrate, MigrateCommand
from flask_migrate import Migrate

from app import create_app, db


application = create_app(os.getenv('DM_ENVIRONMENT') or 'development')
manager = init_manager(application, 5000, ['./json_schemas'])

application = create_app(os.getenv("DM_ENVIRONMENT") or "development")
migrate = Migrate(application, db)
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
manager.run()
4 changes: 1 addition & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import pytest
from alembic.command import upgrade
from alembic.config import Config
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_migrate import Migrate
from sqlalchemy import inspect

from app import create_app
Expand All @@ -26,7 +25,6 @@ def db_migration(request):
app_env_var_mock.start()
app = create_app('test')
Migrate(app, db)
Manager(db, MigrateCommand)
ALEMBIC_CONFIG = os.path.join(os.path.dirname(__file__), '../migrations/alembic.ini')
config = Config(ALEMBIC_CONFIG)
config.set_main_option("script_location", "migrations")
Expand Down

0 comments on commit 3cd44fa

Please sign in to comment.