# -*- coding: UTF-8 -*-
"""
    项目管理控制台
"""

import os
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from app_main import create_app
from extensions import db
from {{cookiecutter.app_name}}.models import models

app = create_app(os.getenv('{{cookiecutter.project_name}}_CONFIG') or 'default')
manage = Manager(app)

migrate = Migrate(app, db)

manage.add_command('db', MigrateCommand)

if __name__ == '__main__':
    manage.run()

    """
        python manage.py db init
        python manage.py db migrate
        python manage.py db upgrade
    """
예제 #2
0
"""
This is a mad lib app made using Flask.

`mad-lib-app.py` defines the Flask application instance and includes a few
tasks that help manage the control flow of the application.
"""
# imports
from app_main import create_app

# create flask application instance
app = create_app()
예제 #3
0
from app_main import create_app

app = create_app('config.py')

if __name__ == '__main__':
    app.run()