开发者

examples of common middleware people use in pylons?

开发者 https://www.devze.com 2023-01-16 15:40 出处:网络
Just trying to get a feel for what common middleware people use in pylons? Is middleware开发者_如何学Python just the main pipeline for the request and response object?

Just trying to get a feel for what common middleware people use in pylons?

Is middleware开发者_如何学Python just the main pipeline for the request and response object?

i.e. would it be possbile to create a very simple middleware that outputs 'hello world' to the screen?


The default middleware is the pipeline, as you guessed. However, my impression is that after that, "common middleware" is slightly oxymoronic, especially for a loosely coupled framework like Pylons. The framework's setup suggests "here is the basic middleware - and here's where to put middleware that you write yourself to satisfy your individual needs." I could be talking through my hat, but that's how it feels to me - when I've thought "should that be middleware?" about modules of mine, the answer has always so far turned out to be "nope, I can just put that in a controller." So - be aware of scope and don't boot things to a middleware layer if you can gracefully keep them closer to the context where you need them.

Further: The WSGI wiki has a list of middleware that may also go some ways towards answering your question.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号