0

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

Is middleware 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?

Blankman
  • 259,732
  • 324
  • 769
  • 1,199
  • "would it be possbile to create a very simple middleware that outputs 'hello world' to the screen" By definition, no. Middleware isn't supposed to do "real" work. It's in the "middle". What are you asking? Are you asking for a definition of middleware? – S.Lott Sep 14 '10 at 13:40
  • Related question: http://stackoverflow.com/questions/2904854/what-is-middleware-exactly/2904865#2904865 – aioobe Sep 14 '10 at 13:50
  • @aioobe i'm talking about middleware in pylons... – Blankman Sep 14 '10 at 14:06
  • sorry updating the title, forget to mention pylons doh! – Blankman Sep 14 '10 at 14:07

1 Answers1

1

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.

Brighid McDonnell
  • 4,293
  • 4
  • 36
  • 61