コード例 #1
0
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
ファイル: app.py プロジェクト: swishswish123/week_6
from my_app import create_app, config

app = create_app(config.Config)

if __name__ == '__main__':
    app.run()
コード例 #6
0
# -*- coding: utf-8 -*-
import my_app

app = my_app.create_app()

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

コード例 #7
0
ファイル: app.py プロジェクト: hoyan412/comp0034_week9
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()
コード例 #9
0
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
ファイル: tests.py プロジェクト: gunderodd/my_microblog
 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
コード例 #16
0
 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
ファイル: run.py プロジェクト: stoltzmaniac/sanic_boilerplate
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')