示例#1
0
def pytest_configure(config):

    try:
        from pynta.conf import setup_settings
    except ImportError:
        # No pynta on PYTHONPATH. May be we are in the source dir?
        src_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
            os.pardir, 'src'))
        if os.path.exists(src_path):
            # Let's import from there then.
            sys.path.insert(0, src_path)
            from pynta.conf import setup_settings

    setup_settings('fixture_project.settings')
示例#2
0
文件: main.py 项目: 54wang17/pynta
def main():
    params = argument_parser.parse_args()
    setup_settings(params.settings)
    # @todo: handle host, port and app in params
    serve('localhost', 8000, get_main_app())