akindices/manage.py
2015-06-22 13:53:55 -08:00

20 lines
429 B
Python

#!/usr/bin/env python
import os
from app import create_app, db
from flask.ext.script import Manager, Shell
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
@manager.command
def initdb():
# Need to import models in order for Flask-SQLAlchemy to create them
from app.models import Community, Dataset, Temperature
db.create_all(app=app)
if __name__ == '__main__':
manager.run()