def serve(port=8000, profile=False, site=None, sites_path='.'): global application, _site, _sites_path _site = site _sites_path = sites_path from werkzeug.serving import run_simple if profile: application = ProfilerMiddleware(application, sort_by=('tottime', 'calls')) if not os.environ.get('NO_STATICS'): application = SharedDataMiddleware( application, { '/assets': os.path.join(sites_path, 'assets'), }) application = StaticDataMiddleware( application, {'/files': os.path.abspath(sites_path)}) run_simple('0.0.0.0', int(port), application, use_reloader=True, use_debugger=True, use_evalex=True, threaded=True)
def serve(ip_address='0.0.0.0', port=8000, profile=False, no_reload=False, no_threading=False, site=None, sites_path='.'): global application, _site, _sites_path _site = site _sites_path = sites_path from werkzeug.serving import run_simple if profile: application = ProfilerMiddleware(application, sort_by=('cumtime', 'calls')) if not os.environ.get('NO_STATICS'): application = SharedDataMiddleware(application, { str('/assets'): str(os.path.join(sites_path, 'assets')) }) application = StaticDataMiddleware(application, { str('/files'): str(os.path.abspath(sites_path)) }) application.debug = True application.config = { 'SERVER_NAME': 'localhost:8000' } in_test_env = os.environ.get('CI') if in_test_env: log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) # pcon - Make this a variable, so you can change between 0.0.0.0, or 127.0.0.1, or whatever you want. run_simple(ip_address, int(port), application, use_reloader=False if in_test_env else not no_reload, use_debugger=not in_test_env, use_evalex=not in_test_env, threaded=not no_threading)
def serve(port=8000, profile=False, site=None, sites_path='.'): global application, _site, _sites_path _site = site _sites_path = sites_path from werkzeug.serving import run_simple if profile: application = ProfilerMiddleware(application, sort_by=('cumtime', 'calls')) if not os.environ.get('NO_STATICS'): application = SharedDataMiddleware( application, { '/assets': os.path.join(sites_path, 'assets'), }) application = StaticDataMiddleware( application, {'/files': os.path.abspath(sites_path)}) application.debug = True application.config = {'SERVER_NAME': 'localhost:8000'} in_test_env = os.environ.get('CI') if in_test_env: log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) run_simple('0.0.0.0', int(port), application, use_reloader=not in_test_env, use_debugger=not in_test_env, use_evalex=not in_test_env, threaded=True)
def serve(port=8000, profile=False, site=None, sites_path='.'): global application, _site, _sites_path _site = site _sites_path = sites_path from werkzeug.serving import run_simple if profile: application = ProfilerMiddleware(application, sort_by=('cumtime', 'calls')) if not os.environ.get('NO_STATICS'): application = SharedDataMiddleware( application, { b'/assets': os.path.join(sites_path, 'assets').encode("utf-8"), }) application = StaticDataMiddleware( application, {b'/files': os.path.abspath(sites_path).encode("utf-8")}) application.debug = True application.config = {'SERVER_NAME': 'localhost:8000'} run_simple('0.0.0.0', int(port), application, use_reloader=True, use_debugger=True, use_evalex=True, threaded=True)
def serve(port=8000, profile=False, no_reload=False, no_threading=False, site=None, sites_path="."): global application, _site, _sites_path _site = site _sites_path = sites_path from werkzeug.serving import run_simple patch_werkzeug_reloader() if profile: application = ProfilerMiddleware(application, sort_by=("cumtime", "calls")) if not os.environ.get("NO_STATICS"): application = SharedDataMiddleware( application, {str("/assets"): str(os.path.join(sites_path, "assets"))}) application = StaticDataMiddleware( application, {str("/files"): str(os.path.abspath(sites_path))}) application.debug = True application.config = {"SERVER_NAME": "localhost:8000"} log = logging.getLogger("werkzeug") log.propagate = False in_test_env = os.environ.get("CI") if in_test_env: log.setLevel(logging.ERROR) run_simple( "0.0.0.0", int(port), application, use_reloader=False if in_test_env else not no_reload, use_debugger=not in_test_env, use_evalex=not in_test_env, threaded=not no_threading, )
update_comments_in_parent_after_request() return rollback application = local_manager.make_middleware(application) if os.environ.get('FRAPPE_PROFILE'): application = ProfilerMiddleware(application, sort_by=('cumtime', 'calls')) if os.environ.get('FRAPPE_STATICS'): application = SharedDataMiddleware( application, { b'/assets': os.path.join('.', 'assets').encode("utf-8"), }) application = StaticDataMiddleware( application, {b'/files': os.path.abspath('.').encode("utf-8")}) if os.environ.get('FRAPPE_DEBUG'): application.debug = True def serve(port=8000, profile=False, site=None, sites_path='.'): global application, _site, _sites_path _site = site _sites_path = sites_path from werkzeug.serving import run_simple if profile: application = ProfilerMiddleware(application, sort_by=('cumtime', 'calls'))