Пример #1
0
def reset():
    app = init_app()
    db = SQLAlchemy(app)
    db.drop_all()
    db.reset_all()
Пример #2
0
"""Application entry point."""
from dsadata import init_app

app = init_app()

if __name__ == "__main__":
    app.run(host="0.0.0.0", debug=True)
Пример #3
0
from logging.config import fileConfig

from alembic import context
from sqlalchemy import engine_from_config
from sqlalchemy import pool

import sys

sys.path = ["", ".."] + sys.path[1:]

import dsadata

# There's no access to current_app here so we must create our own app.
app = dsadata.init_app()
db_uri = app.config["SQLALCHEMY_DATABASE_URI"]
db = app.extensions["sqlalchemy"].db

# Provide access to the values within alembic.ini.
config = context.config

# Sets up Python logging.
fileConfig(config.config_file_name)

# Sets up metadata for autogenerate support,
config.set_main_option("sqlalchemy.url", db_uri)
target_metadata = db.metadata

# Configure anything else you deem important, example:
# my_important_option = config.get_main_option("my_important_option")

Пример #4
0
def test_init_app():
    app = init_app()
    assert app.config["SQLALCHEMY_DATABASE_URI"]
Пример #5
0
def app():
    app = init_app()
    return app