"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/patterns/appdispatch.rst" between
flask-1.1.1.tar.gz and flask-1.1.2.tar.gz

About: Flask is a lightweight Python WSGI web application framework.

appdispatch.rst  (flask-1.1.1):appdispatch.rst  (flask-1.1.2)
skipping to change at line 63 skipping to change at line 63
If you have entirely separated applications and you want them to work next 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 to each other in the same Python interpreter process you can take
advantage of the :class:`werkzeug.wsgi.DispatcherMiddleware`. The idea advantage of the :class:`werkzeug.wsgi.DispatcherMiddleware`. The idea
here is that each Flask application is a valid WSGI application and they here is that each Flask application is a valid WSGI application and they
are combined by the dispatcher middleware into a larger one that is are combined by the dispatcher middleware into a larger one that is
dispatched based on prefix. dispatched based on prefix.
For example you could have your main application run on ``/`` and your For example you could have your main application run on ``/`` and your
backend interface on ``/backend``:: backend interface on ``/backend``::
from werkzeug.wsgi import DispatcherMiddleware from werkzeug.middleware.dispatcher import DispatcherMiddleware
from frontend_app import application as frontend from frontend_app import application as frontend
from backend_app import application as backend from backend_app import application as backend
application = DispatcherMiddleware(frontend, { application = DispatcherMiddleware(frontend, {
'/backend': backend '/backend': backend
}) })
Dispatch by Subdomain Dispatch by Subdomain
--------------------- ---------------------
Sometimes you might want to use multiple instances of the same application Sometimes you might want to use multiple instances of the same application
with different configurations. Assuming the application is created inside with different configurations. Assuming the application is created inside
a function and you can call that function to instantiate it, that is a function and you can call that function to instantiate it, that is
really easy to implement. In order to develop your application to support really easy to implement. In order to develop your application to support
creating new instances in functions have a look at the creating new instances in functions have a look at the
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)