pnut-matrix/manage.py

18 lines
453 B
Python
Raw Permalink Normal View History

2017-03-04 19:29:44 +00:00
import yaml
from appservice import app
from models import *
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
with open("config.yaml", "rb") as config_file:
config = yaml.load(config_file)
app.config['SQLALCHEMY_DATABASE_URI'] = config['SQLALCHEMY_DATABASE_URI']
manager.run()