Esempio n. 1
0
from myapi.app import create_app

app = create_app()

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

    with app.app_context():
        yield app
Esempio 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()
Esempio n. 6
0
import os

from myapi.app import create_app

application = create_app()
def app():
    _app = create_app(testing=True)
    ctx = _app.test_request_context()
    ctx.push()
    yield _app
    ctx.pop()
def client():
    _app = create_app(testing=True)
    _client = _app.test_client()
    yield _client
Esempio n. 9
0
def create_myapi(info):
    return create_app(cli=True)
Esempio 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