Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Module « flask.cli »

Fonction run_simple - module flask.cli

Signature de la fonction run_simple

def run_simple(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) -> 'None' 

Description

help(flask.cli.run_simple)

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 efficient, stable, or secure.

:param hostname: The host to bind to, for example ``'localhost'``.
    Can be a domain, IPv4 or IPv6 address, or file path starting
    with ``unix://`` for a Unix socket.
:param port: The port to bind to, for example ``8080``. Using ``0``
    tells the OS to pick a random free port.
:param application: The WSGI application to run.
:param use_reloader: Use a reloader process to restart the server
    process when files are changed.
:param use_debugger: Use Werkzeug's debugger, which will show
    formatted tracebacks on unhandled exceptions.
:param use_evalex: Make the debugger interactive. A Python terminal
    can be opened for any frame in the traceback. Some protection is
    provided by requiring a PIN, but this should never be enabled
    on a publicly visible server.
:param extra_files: The reloader will watch these files for changes
    in addition to Python modules. For example, watch a
    configuration file.
:param exclude_patterns: The reloader will ignore changes to any
    files matching these :mod:`fnmatch` patterns. For example,
    ignore cache files.
:param reloader_interval: How often the reloader tries to check for
    changes.
:param reloader_type: The reloader to use. The ``'stat'`` reloader
    is built in, but may require significant CPU to watch files. The
    ``'watchdog'`` reloader is much more efficient but requires
    installing the ``watchdog`` package first.
:param threaded: Handle concurrent requests using threads. Cannot be
    used with ``processes``.
:param processes: Handle concurrent requests using up to this number
    of processes. Cannot be used with ``threaded``.
:param request_handler: Use a different
    :class:`~BaseHTTPServer.BaseHTTPRequestHandler` subclass to
    handle requests.
:param static_files: A dict mapping URL prefixes to directories to
    serve static files from using
    :class:`~werkzeug.middleware.SharedDataMiddleware`.
:param passthrough_errors: Don't catch unhandled exceptions at the
    server level, let the server crash instead. If ``use_debugger``
    is enabled, the debugger will still catch such errors.
:param ssl_context: Configure TLS to serve over HTTPS. Can be an
    :class:`ssl.SSLContext` object, a ``(cert_file, key_file)``
    tuple to create a typical context, or the string ``'adhoc'`` to
    generate a temporary self-signed certificate.

.. versionchanged:: 2.1
    Instructions are shown for dealing with an "address already in
    use" error.

.. versionchanged:: 2.1
    Running on ``0.0.0.0`` or ``::`` shows the loopback IP in
    addition to a real IP.

.. versionchanged:: 2.1
    The command-line interface was removed.

.. versionchanged:: 2.0
    Running on ``0.0.0.0`` or ``::`` shows a real IP address that
    was bound as well as a warning not to run the development server
    in production.

.. versionchanged:: 2.0
    The ``exclude_patterns`` parameter was added.

.. versionchanged:: 0.15
    Bind to a Unix socket by passing a ``hostname`` that starts with
    ``unix://``.

.. versionchanged:: 0.10
    Improved the reloader and added support for changing the backend
    through the ``reloader_type`` parameter.

.. versionchanged:: 0.9
    A command-line interface was added.

.. versionchanged:: 0.8
    ``ssl_context`` can be a tuple of paths to the certificate and
    private key files.

.. versionchanged:: 0.6
    The ``ssl_context`` parameter was added.

.. versionchanged:: 0.5
   The ``static_files`` and ``passthrough_errors`` parameters were
   added.


Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé