Would you have WSGI middleware examples?

46 views
Skip to first unread message

Tonjae Euh

unread,
Dec 21, 2011, 8:06:18 AM12/21/11
to circuits
Hello,
Circuits is greate work!
But documents are scattered and I can't fine a middleware example.
Would you have examples?

James Mills

unread,
Dec 24, 2011, 6:30:10 AM12/24/11
to circuit...@googlegroups.com
Hello,

Do you mean circuits.web - the web framework?

Please define more specifically what you mean by "middle-ware".
The reason I say this is because of the way circuits.web is
designed (on top of the circuits asynchronous framework)
circuits.web makes no distinction between WSGI Applications,
Middle-ware or Gateways. They are all just "components" that
behave differently and unfortunately there was no clear concept
that could be brought over to circuits.web from WSGI that made
sense for defining "middle-ware behavior".

For example, in my view WSGI Middle-ware means
modifying some part of the request/response as it
is processes through a WSGI Application/Gateway
in some way.

circuits.web achieves this very well by use of the
circuits architecture (components and event handlers)
by allowing you to defining components that allow you
to intercept the request/response and modify it on it's
way through from User to Server and back to User.

I hope this makes sense and if you have further questions
please don't hesitate to ask or come speak to me on
IRC :)

cheers
James


James Mills / prologic

Developer | circuits, sahriswiki
E: prol...@shortcircuit.net.au
S: therealprologic




--
You received this message because you are subscribed to the Google Groups "circuits" group.
To post to this group, send email to circuit...@googlegroups.com.
To unsubscribe from this group, send email to circuits-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/circuits-users?hl=en.


Tonjae Euh

unread,
Dec 25, 2011, 1:30:45 AM12/25/11
to circuits
Hi, James

Oh “WSGI” is missing. I'm sorry. “middleware” I said, it was meant to
be a WSGI middleware. I had not be discreet.

Thank you for your detailed explanation. I can understand that I have
to intercept request and response in component. But I'm still
wondering how to handle ingress and egress in WSGI middleware stack.
This month, I wrote a authentication and authorisation package using
repoze.who, repoze.what and PyMongo. I'd be happy to apply the things
within circuits.web. I'll try.

Thank you

cheers
Ton-jae

Euh Ton-jae

James Mills

unread,
Dec 25, 2011, 7:04:44 AM12/25/11
to circuit...@googlegroups.com
Hi,

There are a couple of "middle-ware" (ish) examples in
circuits.web under the examples directory. Should come
packaged with circuits - or it's in the source tree.

There's also a few authentication examples as well
including shadow auth.

cheers
James

James Mills / prologic

Developer | circuits, sahriswiki
E: prol...@shortcircuit.net.au
S: therealprologic



Reply all
Reply to author
Forward
0 new messages