示例#1
0
def app():
    """Flask app instance."""
    _app = create_app(config)
    ctx = _app.test_request_context()
    ctx.push()

    yield _app

    ctx.pop()
示例#2
0
def app():
    """Flask app instance."""
    _app = create_app(config)
    ctx = _app.test_request_context()
    ctx.push()

    yield _app

    ctx.pop()
示例#3
0
#!/usr/bin/env python
"""Worker module for creating celery workers."""

from matl_online.app import create_app, celery
from matl_online.settings import config

app = create_app(config)
app.app_context().push()
celery.conf.update(app.config)
示例#4
0
def test_production_config():
    """Production config."""
    app = create_app(ProdConfig)
    assert app.config['ENV'] == 'prod'
    assert app.config['DEBUG'] is False
    assert app.config['ASSETS_DEBUG'] is False
示例#5
0
def test_dev_config():
    """Development config."""
    app = create_app(DevConfig)
    assert app.config['ENV'] == 'dev'
    assert app.config['DEBUG'] is True
    assert app.config['ASSETS_DEBUG'] is True
示例#6
0
from glob import glob
from subprocess import call

from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Server, Shell, Command, Option
from flask_script.commands import Clean, ShowUrls

from matl_online.app import create_app, socketio
from matl_online.database import db
from matl_online import matl
from matl_online.settings import config

eventlet.monkey_patch()

app = create_app(config)

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


def _make_context():
    """Return context dict for a shell session."""
    return {'app': app, 'db': db}


@manager.command
def test():
    """Run the tests."""
    import pytest
    test_path = os.path.join(config.PROJECT_ROOT, 'tests')
示例#7
0
"""Script for initializing a production app for use with uwsgi."""

import eventlet
eventlet.monkey_patch()

from matl_online.app import create_app
from matl_online.settings import ProdConfig

app = create_app(ProdConfig)
示例#8
0
"""Script for initializing a production app for use with uwsgi."""

import eventlet

eventlet.monkey_patch()

from matl_online.app import create_app
from matl_online.settings import ProdConfig

app = create_app(ProdConfig)