
from flask import Flask

app = Flask(__name__)  # pylint: disable=invalid-name
app.config.from_object('config')

# commented as for file structure, should recover later.
# from app import models


@app.route('/')
@app.route('/hellworld')
def helloworld():
    """ Hello World for app. """
    return 'Hello world from {}!'.format(__name__)


from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)  # pylint: disable=invalid-name
app.config.from_object('config')

# commented as for file structure, should recover later.
# from app import models

db = SQLAlchemy(app)


@app.route('/')
@app.route('/hellworld')
def helloworld():
    """ Hello World for app. """
    return 'Hello world from {}!'.format(__name__)

Create model in config file.
Create model in config file.

  
  from flask import Flask
+ from flask.ext.sqlalchemy import SQLAlchemy
  
  app = Flask(__name__)  # pylint: disable=invalid-name
  app.config.from_object('config')
  
  # commented as for file structure, should recover later.
  # from app import models
+ 
+ db = SQLAlchemy(app)
  
  
  @app.route('/')
  @app.route('/hellworld')
  def helloworld():
      """ Hello World for app. """
      return 'Hello world from {}!'.format(__name__)
  
Create model in config file.
## Code Before:

from flask import Flask

app = Flask(__name__)  # pylint: disable=invalid-name
app.config.from_object('config')

# commented as for file structure, should recover later.
# from app import models


@app.route('/')
@app.route('/hellworld')
def helloworld():
    """ Hello World for app. """
    return 'Hello world from {}!'.format(__name__)

## Instruction:
Create model in config file.
## Code After:

from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy

app = Flask(__name__)  # pylint: disable=invalid-name
app.config.from_object('config')

# commented as for file structure, should recover later.
# from app import models

db = SQLAlchemy(app)


@app.route('/')
@app.route('/hellworld')
def helloworld():
    """ Hello World for app. """
    return 'Hello world from {}!'.format(__name__)
