def app(request):
    """ Returns a session wide Flask app """
    _app = create_app(TestingConfig)
    ctx = _app.app_context()
    ctx.push()
    yield _app
    ctx.pop()
示例#2
0
    def setup(self):
        self.app = create_app(config_name='testing')
        self.client = self.app.test_client
        self.driver_info = {'loc': 1.345000, 'lat': 1.345000, 'acc': 0.8}

        with self.app.app_context():
            db.create_all()
示例#3
0
def main():

    app = my_app.create_app()
    dxhandler = dxpy.get_handler(dxpy.JOB_ID)
    dxhandler.set_properties({"httpsAppState": "running"})
    app.run_server(host='0.0.0.0', port=443)

    return 1
示例#4
0
def main():

    app = my_app.create_app()
    dxhandler = dxpy.get_handler(dxpy.JOB_ID)
    dxhandler.set_properties({"httpsAppState": "running"})
    app.run_server(host='0.0.0.0', port=443)

    return 1
示例#5
0
from my_app import create_app, config

app = create_app(config.Config)

if __name__ == '__main__':
    app.run()
# -*- coding: utf-8 -*-
import my_app

app = my_app.create_app()

if __name__ == '__main__':
    app.run_server(debug=True)

示例#7
0
from my_app import create_app, config

app = create_app(config.DevelopmentConfig)

if __name__ == '__main__':
    app.run()
示例#8
0
 def setUp(self):
     """
     Sets up the Flask application for testing
     """
     app = create_app('config.TestingConfig')
     self.app = app.test_client()
from my_app import create_app
from flask_script import Manager
import os

__author__ = "Preetam"

app = create_app(os.getenv("FLASK_CONFIG") or "default")
manager = Manager(app)

if __name__ == "__main__":
    manager.run()
示例#10
0
 def create_app(self):
     app = create_app(config.TestingConfig)
     app.config['LIVESERVER_PORT'] = 8943
     return app
示例#11
0
from my_app import create_app

app = create_app('development')

app.run(debug=True)
示例#12
0
 def setUp(self):
     self.app = create_app(TestConfig)
     self.app_context = self.app.app_context()
     self.app_context.push()
     db.create_all()
示例#13
0
# run.py

import os

from my_app import create_app

config_name = os.getenv('FLASK_CONFIG')
app = create_app(config_name)

if __name__ == '__main__':
    app.run('0.0.0.0')
示例#14
0
# coding: utf-8

import os

from flask_script import Manager, Shell

from my_app import create_app, db
from my_app.models import Account, Token

app = create_app(os.environ.get('FLASK_CONFIG') or 'default')


def make_shell_context():
    return dict(app=app, db=db, Account=Account, Token=Token)


manager = Manager(app)
manager.add_command('shell', Shell(make_context=make_shell_context))

# @manager.command
# def test():
#     """运行单元测试"""
#     import unittest
#     tests = unittest.TestLoader().discover('tests')
#     unittest.TextTestRunner(verbosity=2).run(tests)

if __name__ == '__main__':
    manager.run()
示例#15
0
def app():
    test_app = create_app()
    yield test_app
 def create_app(self):
     app = create_app(config.TestingConfig)
     return app
示例#17
0
import os
from flask_migrate import Migrate
from my_app import create_app, db
from my_app.models import User, Role

app = create_app(os.getenv('FLASK_CONFIG') or 'default')
migrate = Migrate(app, db)


@app.shell_context_processor
def make_shell_context():
    return dict(db=db, User=User, Role=Role)


@app.cli.command()
def test():
    import unittest
    tests = unittest.TestLoader().discover('tests')
    unittest.TextTestRunner(verbosity=2).run(tests)
示例#18
0
from my_app import create_app

app = create_app()

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000)
示例#19
0
 def create_app(self):
     return create_app('testing')