Exemple #1
0
def run():
    """
    This method runs the flask app using manager command 
    after adding the routes using the methods in routes folder
    """
    add_resources(app)
    register_blueprints(app)
    app.run()
Exemple #2
0
def run():
    # import pdb; pdb.set_trace()
    """
    This method runs the flask app using manager command 
    after adding the routes using the methods in routes folder
    """
    add_resources(app)
    app.register_blueprint(api_blueprint)
    register_blueprints(app)
    app.run()
Exemple #3
0
import os
import unittest
from flask import Flask
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from app.main import create_app, db
from app.main.routes import add_resources, register_blueprints
from app.main.models import *
from app.main import api, api_blueprint

app = create_app(os.getenv("FLASK_ENV") or "dev")
app.app_context().push()
manager = Manager(app)
migrate = Migrate(app, db, render_as_batch=True)
manager.add_command("db", MigrateCommand)
add_resources(app)
app.register_blueprint(api_blueprint)
register_blueprints(app)

#app = Flask(__name__)

# @app.route('/')
# def hello_world():
#     return 'Hello World! Parth'


@manager.command
def run():
    """
    This method runs the flask app using manager command
    after adding the routes using the methods in routes folder