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,
)
| 959 | |
| 960 | |
| 961 | def 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 |