MCPcopy
hub / github.com/pallets/werkzeug / run_simple

Function run_simple

src/werkzeug/serving.py:961–1126  ·  view source on GitHub ↗

Start a development server for a WSGI application. Various optional features can be enabled. .. warning:: Do not use the development server when deploying to production. It is intended for use only during local development. It is not designed to be particularly effi

(
    hostname: str,
    port: int,
    application: WSGIApplication,
    use_reloader: bool = False,
    use_debugger: bool = False,
    use_evalex: bool = True,
    extra_files: t.Iterable[str] | None = None,
    exclude_patterns: t.Iterable[str] | None = None,
    reloader_interval: int = 1,
    reloader_type: str = "auto",
    threaded: bool = False,
    processes: int = 1,
    request_handler: type[WSGIRequestHandler] | None = None,
    static_files: dict[str, str | tuple[str, str]] | None = None,
    passthrough_errors: bool = False,
    ssl_context: _TSSLContextArg | None = None,
)

Source from the content-addressed store, hash-verified

959
960
961def run_simple(
962 hostname: str,
963 port: int,
964 application: WSGIApplication,
965 use_reloader: bool = False,
966 use_debugger: bool = False,
967 use_evalex: bool = True,
968 extra_files: t.Iterable[str] | None = None,
969 exclude_patterns: t.Iterable[str] | None = None,
970 reloader_interval: int = 1,
971 reloader_type: str = "auto",
972 threaded: bool = False,
973 processes: int = 1,
974 request_handler: type[WSGIRequestHandler] | None = None,
975 static_files: dict[str, str | tuple[str, str]] | None = None,
976 passthrough_errors: bool = False,
977 ssl_context: _TSSLContextArg | None = None,
978) -> None:
979 """Start a development server for a WSGI application. Various
980 optional features can be enabled.
981
982 .. warning::
983
984 Do not use the development server when deploying to production.
985 It is intended for use only during local development. It is not
986 designed to be particularly efficient, stable, or secure.
987
988 :param hostname: The host to bind to, for example ``'localhost'``.
989 Can be a domain, IPv4 or IPv6 address, or file path starting
990 with ``unix://`` for a Unix socket.
991 :param port: The port to bind to, for example ``8080``. Using ``0``
992 tells the OS to pick a random free port.
993 :param application: The WSGI application to run.
994 :param use_reloader: Use a reloader process to restart the server
995 process when files are changed.
996 :param use_debugger: Use Werkzeug's debugger, which will show
997 formatted tracebacks on unhandled exceptions.
998 :param use_evalex: Make the debugger interactive. A Python terminal
999 can be opened for any frame in the traceback. Some protection is
1000 provided by requiring a PIN, but this should never be enabled
1001 on a publicly visible server.
1002 :param extra_files: The reloader will watch these files for changes
1003 in addition to Python modules. For example, watch a
1004 configuration file.
1005 :param exclude_patterns: The reloader will ignore changes to any
1006 files matching these :mod:`fnmatch` patterns. For example,
1007 ignore cache files.
1008 :param reloader_interval: How often the reloader tries to check for
1009 changes.
1010 :param reloader_type: The reloader to use. The ``'stat'`` reloader
1011 is built in, but may require significant CPU to watch files. The
1012 ``'watchdog'`` reloader is much more efficient but requires
1013 installing the ``watchdog`` package first.
1014 :param threaded: Handle concurrent requests using threads. Cannot be
1015 used with ``processes``.
1016 :param processes: Handle concurrent requests using up to this number
1017 of processes. Cannot be used with ``threaded``.
1018 :param request_handler: Use a different

Callers 15

test_port_is_intFunction · 0.90
run.pyFile · 0.90
runserverFunction · 0.90
runserverFunction · 0.90
runserverFunction · 0.90
httpbasicauth.pyFile · 0.90
runserverFunction · 0.90
wsecho.pyFile · 0.90
runserverFunction · 0.90
runserverFunction · 0.90
runserverFunction · 0.90
runserverFunction · 0.90

Calls 10

DebuggedApplicationClass · 0.85
is_running_from_reloaderFunction · 0.85
make_serverFunction · 0.85
_logFunction · 0.85
_ansi_styleFunction · 0.85
run_with_reloaderFunction · 0.85
appendMethod · 0.80
log_startupMethod · 0.80
serve_foreverMethod · 0.80

Tested by 1

test_port_is_intFunction · 0.72