Ejemplo n.º 1
0
 def create_app(self):
     """
     Overload base version to hide the GIL (allows registration of ePROMs)
     """
     tc = TestConfig()
     setattr(tc, 'HIDE_GIL', True)
     self._app = create_app(tc)
     return self._app
Ejemplo n.º 2
0
 def create_app(self):
     """
     Overload base version to hide the GIL (allows registration of ePROMs)
     """
     tc = TestConfig()
     setattr(tc, 'HIDE_GIL', True)
     self._app = create_app(tc)
     return self._app
Ejemplo n.º 3
0
""" WSGI Entry Point

"""

from werkzeug.contrib.fixers import ProxyFix

from portal.factories.app import create_app

# WSGI object is named "application" by default
# https://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGICallableObject.html
application = create_app()

if application.config.get('PREFERRED_URL_SCHEME', '').lower() == 'https':
    application.wsgi_app = ProxyFix(application.wsgi_app)
Ejemplo n.º 4
0
    def create_app(self):
        """Create and return a testing flask app."""

        self._app = create_app(TestConfig)
        return self._app
Ejemplo n.º 5
0
from portal.models.relationship import add_static_relationships
from portal.models.role import ROLE, Role, add_static_roles
from portal.models.user import (
    User,
    flag_test,
    permanently_delete_user,
    validate_email,
)
from portal.models.url_token import (
    BadSignature,
    SignatureExpired,
    verify_token,
)
from portal.tasks import celery_beat_health_check

app = create_app()

MIGRATIONS_DIR = os.path.join(app.root_path, 'migrations')
migrate = Migrate(app, db, directory=MIGRATIONS_DIR)


def _run_alembic_command(args):
    """Helper to manage working directory and run given alembic commands"""
    # Alembic looks for the alembic.ini file in CWD
    # hop over there and then return to CWD
    cwd = os.getcwd()
    os.chdir(MIGRATIONS_DIR)

    alembic.config.main(argv=args)

    os.chdir(cwd)  # restore cwd
Ejemplo n.º 6
0
from portal.extensions import db, user_manager
from portal.factories.app import create_app
from portal.models.fhir import add_static_concepts
from portal.models.i18n import smartling_download, smartling_upload
from portal.models.intervention import add_static_interventions
from portal.models.organization import add_static_organization
from portal.models.relationship import add_static_relationships
from portal.models.role import ROLE, Role, add_static_roles
from portal.models.user import (
    User,
    flag_test,
    permanently_delete_user,
    validate_email,
)

app = create_app()

MIGRATIONS_DIR = os.path.join(app.root_path, 'migrations')
migrate = Migrate(app, db, directory=MIGRATIONS_DIR)


def _run_alembic_command(args):
    """Helper to manage working directory and run given alembic commands"""
    # Alembic looks for the alembic.ini file in CWD
    # hop over there and then return to CWD
    cwd = os.getcwd()
    os.chdir(MIGRATIONS_DIR)

    alembic.config.main(argv=args)

    os.chdir(cwd)  # restore cwd