Exemplo n.º 1
0
    def create_app(self):
        app = Flask(config.APP_NAME)
        app = create_app(app)
        app.config["TESTING"] = True

        if app.config.get('TEST_DB_URI') is None:
            raise TestCaseDBException("No TEST_DB_URI specified in config.py!")

        app.config['SQLALCHEMY_DATABASE_URI'] = app.config.get('TEST_DB_URI')
        self.migration = Migration(app)
        return app
Exemplo n.º 2
0
import os
import subprocess
import errno

from flask import Flask
from flask.ext.script import Manager, Shell

import config
from mould.app import create_app
from mould.gunicorn_app import GunicornApp
from mould.utils import touch
from mould.utils import blueprint_template
from mould.migration import Migration

app = create_app(Flask(config.APP_NAME))
manager = Manager(app)

@manager.command
def server(port=5000):
    """Run gunicorn server"""
    options = {
        "bind": "0.0.0.0:%s" % port,
        "workers": 4,
        }
    gunicorn_app = GunicornApp(options, app)
    gunicorn_app.run()


@manager.command
def test():
    """Run tests"""