|
|
|
@ -4,11 +4,11 @@ Application Dispatching
|
|
|
|
|
======================= |
|
|
|
|
|
|
|
|
|
Application dispatching is the process of combining multiple Flask |
|
|
|
|
applications on the WSGI level. You can not only combine Flask |
|
|
|
|
applications into something larger but any WSGI application. This would |
|
|
|
|
even allow you to run a Django and a Flask application in the same |
|
|
|
|
interpreter side by side if you want. The usefulness of this depends on |
|
|
|
|
how the applications work internally. |
|
|
|
|
applications on the WSGI level. You can combine not only Flask |
|
|
|
|
applications but any WSGI application. This would allow you to run a |
|
|
|
|
Django and a Flask application in the same interpreter side by side if |
|
|
|
|
you want. The usefulness of this depends on how the applications work |
|
|
|
|
internally. |
|
|
|
|
|
|
|
|
|
The fundamental difference from the :ref:`module approach |
|
|
|
|
<larger-applications>` is that in this case you are running the same or |
|
|
|
@ -31,7 +31,7 @@ Note that :func:`run_simple <werkzeug.serving.run_simple>` is not intended for
|
|
|
|
|
use in production. Use a :ref:`full-blown WSGI server <deployment>`. |
|
|
|
|
|
|
|
|
|
In order to use the interactive debugger, debugging must be enabled both on |
|
|
|
|
the application and the simple server, here is the "hello world" example with |
|
|
|
|
the application and the simple server. Here is the "hello world" example with |
|
|
|
|
debugging and :func:`run_simple <werkzeug.serving.run_simple>`:: |
|
|
|
|
|
|
|
|
|
from flask import Flask |
|
|
|
@ -56,7 +56,7 @@ If you have entirely separated applications and you want them to work next
|
|
|
|
|
to each other in the same Python interpreter process you can take |
|
|
|
|
advantage of the :class:`werkzeug.wsgi.DispatcherMiddleware`. The idea |
|
|
|
|
here is that each Flask application is a valid WSGI application and they |
|
|
|
|
are combined by the dispatcher middleware into a larger one that |
|
|
|
|
are combined by the dispatcher middleware into a larger one that is |
|
|
|
|
dispatched based on prefix. |
|
|
|
|
|
|
|
|
|
For example you could have your main application run on ``/`` and your |
|
|
|
|