"""
Example manage.py script, which is responsible for providing a command-line
interface to application specific tasks, such as managing databases.
"""

from flask.ext.script import Manager, Command
from flask.ext.migrate import Migrate, MigrateCommand
from models import db
from app import create_app

app = create_app()
migrate = Migrate(app, db)
manager = Manager(app)

class CreateDatabase(Command):
    """
    Creates the database based on models.py
    """

    def run(self):
        with create_app().app_context():
            db.create_all()


manager.add_command('db', MigrateCommand)
manager.add_command('createdb', CreateDatabase())

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

@@ -145,16 +145,144 @@
 ses.%0A%22%22%22
+%0Aimport os, sys%0APROJECT_HOME = os.path.abspath(%0A    os.path.join(os.path.dirname(__file__), '..'))%0Asys.path.append(PROJECT_HOME)
 %0A%0Afrom f
@@ -380,16 +380,19 @@
 nd%0Afrom 
+mc.
 models i
@@ -405,16 +405,19 @@
 db%0Afrom 
+mc.
 app impo
@@ -501,16 +501,17 @@
 r(app)%0A%0A
+%0A
 class Cr
@@ -626,28 +626,19 @@
    with 
-create_
 app
-()
 .app_con

add sys.path import hack