OpenQuizz
Une application de gestion des contenus pédagogiques
werkzeug.serving Namespace Reference

Data Structures

class  _SSLContext
 
class  _SslDummy
 
class  BaseWSGIServer
 
class  DechunkedInput
 
class  ForkingMixIn
 
class  ForkingWSGIServer
 
class  ThreadedWSGIServer
 
class  WSGIRequestHandler
 

Functions

def generate_adhoc_ssl_pair (cn=None)
 
def make_ssl_devcert (base_path, host=None, cn=None)
 
def generate_adhoc_ssl_context ()
 
def load_ssl_context (cert_file, pkey_file=None, protocol=None)
 
def is_ssl_error (error=None)
 
def select_address_family (host, port)
 
def get_sockaddr (host, port, family)
 
def make_server (host=None, port=None, app=None, threaded=False, processes=1, request_handler=None, passthrough_errors=False, ssl_context=None, fd=None)
 
def is_running_from_reloader ()
 
def run_simple (hostname, port, application, use_reloader=False, use_debugger=False, use_evalex=True, extra_files=None, reloader_interval=1, reloader_type="auto", threaded=False, processes=1, request_handler=None, static_files=None, passthrough_errors=False, ssl_context=None)
 
def run_with_reloader (*args, **kwargs)
 
def main ()
 

Variables

 ssl
 
 click
 
 ThreadingMixIn
 
 can_fork
 
 ForkingMixIn
 
 af_unix
 
 LISTEN_QUEUE
 
 can_open_by_fd
 
 BaseRequestHandler
 

Function Documentation

◆ generate_adhoc_ssl_context()

def werkzeug.serving.generate_adhoc_ssl_context ( )
Generates an adhoc SSL context for the development server.

◆ generate_adhoc_ssl_pair()

def werkzeug.serving.generate_adhoc_ssl_pair (   cn = None)

◆ get_sockaddr()

def werkzeug.serving.get_sockaddr (   host,
  port,
  family 
)
Return a fully qualified socket address that can be passed to
:func:`socket.bind`.

◆ is_running_from_reloader()

def werkzeug.serving.is_running_from_reloader ( )
Checks if the application is running from within the Werkzeug
reloader subprocess.

.. versionadded:: 0.10

◆ is_ssl_error()

def werkzeug.serving.is_ssl_error (   error = None)
Checks if the given error (or the current one) is an SSL error.

◆ load_ssl_context()

def werkzeug.serving.load_ssl_context (   cert_file,
  pkey_file = None,
  protocol = None 
)
Loads SSL context from cert/private key files and optional protocol.
Many parameters are directly taken from the API of
:py:class:`ssl.SSLContext`.

:param cert_file: Path of the certificate to use.
:param pkey_file: Path of the private key to use. If not given, the key
                  will be obtained from the certificate file.
:param protocol: One of the ``PROTOCOL_*`` constants in the stdlib ``ssl``
                 module. Defaults to ``PROTOCOL_SSLv23``.

◆ main()

def werkzeug.serving.main ( )
A simple command-line interface for :py:func:`run_simple`.

◆ make_server()

def werkzeug.serving.make_server (   host = None,
  port = None,
  app = None,
  threaded = False,
  processes = 1,
  request_handler = None,
  passthrough_errors = False,
  ssl_context = None,
  fd = None 
)
Create a new server instance that is either threaded, or forks
or just processes one request after another.

◆ make_ssl_devcert()

def werkzeug.serving.make_ssl_devcert (   base_path,
  host = None,
  cn = None 
)
Creates an SSL key for development.  This should be used instead of
the ``'adhoc'`` key which generates a new cert on each server start.
It accepts a path for where it should store the key and cert and
either a host or CN.  If a host is given it will use the CN
``*.host/CN=host``.

For more information see :func:`run_simple`.

.. versionadded:: 0.9

:param base_path: the path to the certificate and key.  The extension
                  ``.crt`` is added for the certificate, ``.key`` is
                  added for the key.
:param host: the name of the host.  This can be used as an alternative
             for the `cn`.
:param cn: the `CN` to use.

◆ run_simple()

def werkzeug.serving.run_simple (   hostname,
  port,
  application,
  use_reloader = False,
  use_debugger = False,
  use_evalex = True,
  extra_files = None,
  reloader_interval = 1,
  reloader_type = "auto",
  threaded = False,
  processes = 1,
  request_handler = None,
  static_files = None,
  passthrough_errors = False,
  ssl_context = None 
)
Start a WSGI application. Optional features include a reloader,
multithreading and fork support.

This function has a command-line interface too::

    python -m werkzeug.serving --help

.. versionadded:: 0.5
   `static_files` was added to simplify serving of static files as well
   as `passthrough_errors`.

.. versionadded:: 0.6
   support for SSL was added.

.. versionadded:: 0.8
   Added support for automatically loading a SSL context from certificate
   file and private key.

.. versionadded:: 0.9
   Added command-line interface.

.. versionadded:: 0.10
   Improved the reloader and added support for changing the backend
   through the `reloader_type` parameter.  See :ref:`reloader`
   for more information.

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

:param hostname: The host to bind to, for example ``'localhost'``.
    If the value is a path that starts with ``unix://`` it will bind
    to a Unix socket instead of a TCP socket..
:param port: The port for the server.  eg: ``8080``
:param application: the WSGI application to execute
:param use_reloader: should the server automatically restart the python
                     process if modules were changed?
:param use_debugger: should the werkzeug debugging system be used?
:param use_evalex: should the exception evaluation feature be enabled?
:param extra_files: a list of files the reloader should watch
                    additionally to the modules.  For example configuration
                    files.
:param reloader_interval: the interval for the reloader in seconds.
:param reloader_type: the type of reloader to use.  The default is
                      auto detection.  Valid values are ``'stat'`` and
                      ``'watchdog'``. See :ref:`reloader` for more
                      information.
:param threaded: should the process handle each request in a separate
                 thread?
:param processes: if greater than 1 then handle each request in a new process
                  up to this maximum number of concurrent processes.
:param request_handler: optional parameter that can be used to replace
                        the default one.  You can use this to replace it
                        with a different
                        :class:`~BaseHTTPServer.BaseHTTPRequestHandler`
                        subclass.
:param static_files: a list or dict of paths for static files.  This works
                     exactly like :class:`SharedDataMiddleware`, it's actually
                     just wrapping the application in that middleware before
                     serving.
:param passthrough_errors: set this to `True` to disable the error catching.
                           This means that the server will die on errors but
                           it can be useful to hook debuggers in (pdb etc.)
:param ssl_context: an SSL context for the connection. Either an
                    :class:`ssl.SSLContext`, a tuple in the form
                    ``(cert_file, pkey_file)``, the string ``'adhoc'`` if
                    the server should automatically create one, or ``None``
                    to disable SSL (which is the default).

◆ run_with_reloader()

def werkzeug.serving.run_with_reloader ( args,
**  kwargs 
)

◆ select_address_family()

def werkzeug.serving.select_address_family (   host,
  port 
)
Return ``AF_INET4``, ``AF_INET6``, or ``AF_UNIX`` depending on
the host and port.

Variable Documentation

◆ af_unix

af_unix

◆ BaseRequestHandler

BaseRequestHandler

◆ can_fork

can_fork

◆ can_open_by_fd

can_open_by_fd

◆ click

click

◆ ForkingMixIn

◆ LISTEN_QUEUE

LISTEN_QUEUE

◆ ssl

ssl

◆ ThreadingMixIn

ThreadingMixIn