Skip to content

Commit

Permalink
Add function which takes arg 'script_info' and calls create_app
Browse files Browse the repository at this point in the history
  • Loading branch information
ferbncode committed Feb 28, 2018
1 parent 201002e commit bc297b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion db/dump_manage.py
Expand Up @@ -8,7 +8,7 @@
import webserver


cli = FlaskGroup(add_default_commands=False, create_app=webserver.create_app)
cli = FlaskGroup(add_default_commands=False, create_app=webserver.create_app_flaskgroup)


@cli.command()
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Expand Up @@ -19,7 +19,7 @@

ADMIN_SQL_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'admin', 'sql')

cli = FlaskGroup(add_default_commands=False, create_app=webserver.create_app)
cli = FlaskGroup(add_default_commands=False, create_app=webserver.create_app_flaskgroup)
cli.add_command(shell_command)


Expand Down
5 changes: 5 additions & 0 deletions webserver/__init__.py
Expand Up @@ -3,6 +3,11 @@

API_PREFIX = '/api/'

def create_app_flaskgroup(script_info):
"""Factory function that accepts script_info and creates a Flask application"""
return create_app()


def create_app_with_configuration(config_path=None):
"""Create a Flask application and load all configuration files"""

Expand Down
2 changes: 1 addition & 1 deletion worker_manage.py
Expand Up @@ -7,7 +7,7 @@
import hl_extractor.hl_calc
import webserver

cli = FlaskGroup(add_default_commands=False, create_app=webserver.create_app)
cli = FlaskGroup(add_default_commands=False, create_app=webserver.create_app_flaskgroup)


@cli.command('hl_extractor')
Expand Down

0 comments on commit bc297b0

Please sign in to comment.