'Runs the application on a local development server.
Do not use ``run()`` in a production setting. It is not intended to
meet security and performance requirements for a production server.
Instead, see :ref:`deployment` for WSGI server recommendations.
If the :attr:`debug` flag is set the server will automatically reload
for code changes and show a debugger in case an exception happened.
If you want to run the application in debug mode, but disable the
code execution on the interactive debugger, you can pass
``use_evalex=False`` as parameter.  This will keep the debugger\'s
traceback screen active, but disable code execution.
It is not recommended to use this function for development with
automatic reloading as this is badly supported.  Instead you should
be using the :command:`flask` command line script\'s ``run`` support.
.. admonition:: Keep in Mind
Flask will suppress any server error with a generic error page
unless it is in debug mode.  As such to enable just the
interactive debugger without the code reloading, you have to
invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.
Setting ``use_debugger`` to ``True`` without being in debug mode
won\'t catch any exceptions because there won\'t be any to
catch.
:param host: the hostname to listen on. Set this to ``\'0.0.0.0\'`` to
have the server available externally as well. Defaults to
``\'127.0.0.1\'`` or the host in the ``SERVER_NAME`` config variable
if present.
:param port: the port of the webserver. Defaults to ``5000`` or the
port defined in the ``SERVER_NAME`` config variable if present.
:param debug: if given, enable or disable debug mode. See
:attr:`debug`.
:param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
files to set environment variables. Will also change the working
directory to the directory containing the first file found.
:param options: the options to be forwarded to the underlying Werkzeug
server. See :func:`werkzeug.serving.run_simple` for more
information.
.. versionchanged:: 1.0
If installed, python-dotenv will be used to load environment
variables from :file:`.env` and :file:`.flaskenv` files.
.. versionchanged:: 0.10
The default port is now picked from the ``SERVER_NAME`` variable.'

def run(self, host=None, port=None, debug=None, load_dotenv=True, **options):

    if (os.environ.get('FLASK_RUN_FROM_CLI') == 'true'):
        from .debughelpers import explain_ignored_app_run
        explain_ignored_app_run()
        return
    if load_dotenv:
        from flask.cli import load_dotenv
        load_dotenv()
    if (debug is not None):
        self._reconfigure_for_run_debug(bool(debug))
    _host = '127.0.0.1'
    _port = 5000
    server_name = self.config.get('SERVER_NAME')
    (sn_host, sn_port) = (None, None)
    if server_name:
        (sn_host, _, sn_port) = server_name.partition(':')
    host = (host or sn_host or _host)
    port = int((port or sn_port or _port))
    options.setdefault('use_reloader', self.debug)
    options.setdefault('use_debugger', self.debug)
    from werkzeug.serving import run_simple
    try:
        run_simple(host, port, self, **options)
    finally:
        self._got_first_request = False
