Пример #1
0
import importlib
import time

import tornado.log
import tornado.ioloop
import requests

from baselayer.app.env import load_env, parser
from baselayer.log import make_log

parser.description = 'Launch app microservice'
parser.add_argument(
    '-p',
    '--process',
    type=int,
    help='Process number, when multiple server processes are used.'
    ' This number gets added to the app port.')
env, cfg = load_env()

log = make_log(f'app_{env.process or 0}')

# We import these later, otherwise them calling load_env interferes
# with argument parsing
from baselayer.app.app_server import (
    handlers as baselayer_handlers,
    settings as baselayer_settings,
)  # noqa: E402

app_factory = cfg['app.factory']
baselayer_settings['cookie_secret'] = cfg['app.secret_key']
baselayer_settings['autoreload'] = env.debug
Пример #2
0
import requests
import pandas as pd
import yaml
from yaml import Loader

from baselayer.app.env import load_env, parser

from skyportal.tests import api
from skyportal.tests.patch_requests import patch_requests

patch_requests()

if __name__ == "__main__":
    parser.description = 'Load data into SkyPortal'
    parser.add_argument('data_files',
                        type=str,
                        nargs='+',
                        help='YAML files with data to load')
    parser.add_argument(
        '--host',
        help=textwrap.dedent(
            '''Fully specified URI of the running SkyPortal instance.
                             E.g., https://myserver.com:9000.

                             Defaults to http://localhost on the port specified
                             in the SkyPortal configuration file.'''),
    )
    parser.add_argument(
        '--token',
        help=textwrap.dedent('''Token required for accessing the SkyPortal API.

                             By default, SkyPortal produces a token that is
Пример #3
0
import importlib
import time

import requests
import tornado.ioloop
import tornado.log

from baselayer.app.env import load_env, parser
from baselayer.log import make_log

parser.description = "Launch app microservice"
parser.add_argument(
    "-p",
    "--process",
    type=int,
    help="Process number, when multiple server processes are used."
    " This number gets added to the app port.",
)
env, cfg = load_env()

log = make_log(f"app_{env.process or 0}")

# We import these later, otherwise them calling load_env interferes
# with argument parsing
from baselayer.app.app_server import handlers as baselayer_handlers  # noqa: E402
from baselayer.app.app_server import settings as baselayer_settings  # noqa: E402

app_factory = cfg["app.factory"]
baselayer_settings["cookie_secret"] = cfg["app.secret_key"]
baselayer_settings["autoreload"] = env.debug