def init(config_name): from importlib import import_module from freenit import create_app from config import configs from name import app_name app = import_module(f'{app_name}') config = configs[config_name] application = create_app(config) app.create_app(application) return application
def init(config_name): from importlib import import_module from freenit import create_app from config import configs from name import app_name app = import_module(f'{app_name}') config = configs[config_name] application = create_app( config, schemas={ 'role': 'tilda.schemas.role', 'user': '******', }, ) app.create_app(application) return application
def app(): config = configs['testing'] flask_app = create_app(config) router = Router( flask_app.db.database, migrate_dir=f'{DEFAULT_MIGRATE_DIR}', ) # log_router = Router( # flask_app.logdb.database, # migrate_dir=f'{DEFAULT_MIGRATE_DIR}/logs', # ) router.run() # log_router.run() yield flask_app flask_app.db.close_db('') # flask_app.logdb.close_db('') current_path = os.path.dirname(__file__)
import os import socket from importlib import import_module from freenit import create_app from config import configs from name import app_name api = import_module(f'{app_name}.api') config_name = os.getenv('FLASK_ENV') or 'default' config = configs[config_name] app = create_app(config) api.create_api(app) hostname = socket.gethostname() port = os.environ.get('FLASK_PORT', 5000) REDOC_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_REDOC_PATH}' REDOC_URL = f'http://{hostname}:{port}{REDOC_PATH}' SWAGGER_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_SWAGGER_UI_PATH}' SWAGGER_URL = f'http://{hostname}:{port}{SWAGGER_PATH}' if __name__ == '__main__': print(' * ReDoc URL:', REDOC_URL) print(' * Swagger URL:', SWAGGER_URL) app.run( host='0.0.0.0', port=port, debug=True, use_reloader=True, )
import os import socket from importlib import import_module from freenit import create_app from config import configs from name import app_name api = import_module(f'{app_name}.api') config_name = os.getenv('FLASK_ENV') or 'default' config = configs[config_name] schemas = { 'user': f'{app_name}.schemas.user', } application = create_app(config, schemas=schemas) api.create_api(application) hostname = socket.gethostname() port = os.environ.get('FLASK_PORT', 5000) SWAGGER_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_SWAGGER_UI_PATH}' SWAGGER_URL = f'http://{hostname}:{port}{SWAGGER_PATH}' if __name__ == '__main__': print(' * Swagger URL:', SWAGGER_URL) application.run( host='0.0.0.0', port=port, debug=True, use_reloader=True, )
from config import configs from freenit import create_app app = create_app(configs['testing']) if __name__ == '__main__': app.run()
import os import socket from importlib import import_module from freenit import create_app from config import configs from name import app_name api = import_module(f'{app_name}.api') config_name = os.getenv('FLASK_ENV') or 'default' config = configs[config_name] application = create_app(config) api.create_api(application) hostname = socket.gethostname() port = os.environ.get('FLASK_PORT', 5000) SWAGGER_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_SWAGGER_UI_PATH}' SWAGGER_URL = f'http://{hostname}:{port}{SWAGGER_PATH}' if __name__ == '__main__': print(' * Swagger URL:', SWAGGER_URL) application.run( host='0.0.0.0', port=port, debug=True, use_reloader=True, )
from importlib import import_module from freenit import create_app from config import configs from name import app_name from tilda.cli import register api = import_module(f'{app_name}.api') config_name = os.getenv('FLASK_ENV') or 'default' config = configs[config_name] schemas = { 'user': f'{app_name}.schemas.user', 'role': f'{app_name}.schemas.role', } application = create_app(config, dbtype='sql', schemas=schemas) api.create_api(application) register(application) hostname = socket.gethostname() port = os.environ.get('FLASK_PORT', 5000) SWAGGER_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_SWAGGER_UI_PATH}' SWAGGER_URL = f'http://{hostname}:{port}{SWAGGER_PATH}' if __name__ == '__main__': print(' * Swagger URL:', SWAGGER_URL) application.run( host='0.0.0.0', port=port, debug=True, use_reloader=True, )
import os import socket from config import configs from freenit import create_app config_name = os.getenv('FLASK_ENV') or 'default' config = configs[config_name] app = create_app(config, 'freenit') hostname = socket.gethostname() port = os.environ.get('FLASK_PORT', 5000) REDOC_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_REDOC_PATH}' REDOC_URL = f'http://{hostname}:{port}{REDOC_PATH}' SWAGGER_PATH = f'{config.OPENAPI_URL_PREFIX}{config.OPENAPI_SWAGGER_UI_PATH}' SWAGGER_URL = f'http://{hostname}:{port}{SWAGGER_PATH}' if __name__ == '__main__': print(' * ReDoc URL:', REDOC_URL) print(' * Swagger URL:', SWAGGER_URL) app.run( host='0.0.0.0', port=port, debug=True, use_reloader=True, )