Middleware for Django and Pylons

It seems to me that Django and Pylons have different ideas about how middleware should work. I like that Pylons follows the standardized PEP 333 , but Django seems to be more widely used. Is it possible to write middleware for use in both?

The project, which includes the aforementioned middleware, migrates a set of security tools called ESAPI from Java to Python. Since Java is so standards-oriented, it's pretty easy to become agnostic. In Python, different structures have different ideas about how basic things like HttpRequest objects and middleware work, so this seems more complicated.

Apparently, new users cannot post more than one hyperlink. See the links below for information on the Django and Pylons middleware.

+3
source share
2 answers

Pylons use standard WSGI middleware. If you are deploying Django through the WSGI, you can also use the WSGI middleware at this point. However, you cannot use the WSGI middleware through the standard Django MIDDLEWARE_CLASSES parameter in settings.py.

, Google Summer of Code, WSGI Django. , Http WSGI.

+3

Pylons middleware WSGI (PEP 333), Django .

, Django apache + mod_wsgi (, , mod_python lighttpd + flup), WSGI Django, , , WSGI, Django Django.

WSGI Django , . , , ORM.

WSGI Wiki WSGI middleware.

0

Source: https://habr.com/ru/post/1713277/


All Articles