Exemplo n.º 1
0
from myapi.app import create_app

app = create_app()

if __name__ == "__main__":
    app.run(host="localhost", port=8080, use_reloader=False)
Exemplo n.º 2
0
def app():
    app = create_app(testing=True)
    return app
Exemplo n.º 3
0
def app():
    load_dotenv(".testenv")
    app = create_app(testing=True)
    return app
Exemplo n.º 4
0
def app():
    app = create_app(config_object=config.TestingConfig)

    with app.app_context():
        yield app
Exemplo n.º 5
0
from myapi.app import create_app
from myapi import config


application = create_app(config_object=config.ProductionConfig)


if __name__ == '__main__':
    application.run()
Exemplo n.º 6
0
import os

from myapi.app import create_app

application = create_app()
Exemplo n.º 7
0
def app():
    _app = create_app(testing=True)
    ctx = _app.test_request_context()
    ctx.push()
    yield _app
    ctx.pop()
Exemplo n.º 8
0
def client():
    _app = create_app(testing=True)
    _client = _app.test_client()
    yield _client
Exemplo n.º 9
0
def create_myapi(info):
    return create_app(cli=True)
Exemplo n.º 10
0
import os
from myapi.app import create_app, db
from myapi.models.users import Users
from flask_script import Manager, Shell

#===Импортируем переменные окружения из файла anyfile.env
if os.path.exists('.env'):
	print('Importing environment from .env...') 
	for line in open('.env'):
		var = line.strip().split('=') 
		if len(var) == 2:
			os.environ[var[0]] = var[1]
#===Запускаем прибожение
app = create_app(os.getenv('FLASK_CONFIG') or 'development')
manager = Manager(app)

newUser = {
          'userID':123,
          'name': 'roma',
          'url': 'ruls',
          'loginType': 'FB',
          'email': 'email',
          'osUserName': '******',
          'password': '******',
          'accesToken': 'accessToken',
        }

def make_shell_context():
	return dict(app=app, db=db, Users=Users, newUser=newUser)

@manager.command