Exemplo n.º 1
0
def main():  # pragma: no cover
    setup_pythonpath()
    try:
        app = get_current_app()
    except NoCurrentApp:
        app = App()

    try:
        app.click()
    except (NoCurrentApp, ConfigurationError) as exc:
        click.echo(str(exc))
        sys.exit(1)
Exemplo n.º 2
0
from apistar import App
from project.routes import routes
from project.models import Base
from apistar.commands import create_tables

settings = {
    "DATABASE": {
        "URL": "sqlite:///db.sqlite3",
        "METADATA": Base.metadata
    }
}
app = App(routes=routes, settings=settings)
app = App(routes=routes, settings=settings, commands=[create_tables])
if __name__ == "__main__":
    app.click()