|
|
@ -10,16 +10,14 @@ from {{cookiecutter.repo_name}}.models import db |
|
|
|
|
|
|
|
|
|
|
|
assets_env = Environment() |
|
|
|
assets_env = Environment() |
|
|
|
|
|
|
|
|
|
|
|
def create_app(config_object, env): |
|
|
|
def create_app(config_object): |
|
|
|
'''An application factory, as explained here: |
|
|
|
'''An application factory, as explained here: |
|
|
|
http://flask.pocoo.org/docs/patterns/appfactories/ |
|
|
|
http://flask.pocoo.org/docs/patterns/appfactories/ |
|
|
|
|
|
|
|
|
|
|
|
:param config_object: The configuration object to use. |
|
|
|
:param config_object: The configuration object to use. |
|
|
|
:param env: A string, the current environment. Either "dev" or "prod" |
|
|
|
|
|
|
|
''' |
|
|
|
''' |
|
|
|
app = Flask(__name__) |
|
|
|
app = Flask(__name__) |
|
|
|
app.config.from_object(config_object) |
|
|
|
app.config.from_object(config_object) |
|
|
|
app.config['ENV'] = env |
|
|
|
|
|
|
|
# Initialize SQLAlchemy |
|
|
|
# Initialize SQLAlchemy |
|
|
|
db.init_app(app) |
|
|
|
db.init_app(app) |
|
|
|
# Register asset bundles |
|
|
|
# Register asset bundles |
|
|
|