类似 Django 的 Zope 中间件
Zope中有类似Django中间件的东西吗?我想要的是,检查并验证所有传入 Zope 服务器的请求,对它们施加一些限制并相应地显示响应。
我之前已经使用中间件在 Django 中完成了此操作,因此希望 Zope 也能得到类似的东西,但找不到它。
请建议。
Is there something similar to Django Middleware in Zope? What I want is, to check and validate all the request coming to Zope server to put some constraints on them and show the response accordingly.
I have done this previously in Django using Middleware, so was hoping to get something similar for Zope as well, but could not find it.
Please suggest.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用基于 zope.schema 的库(例如 formlib 或 z3c.form)来对表单进行建模。
小部件/表单生成和验证基本上是内置的,可以根据需要进行自定义。
You can use zope.schema based libraries like formlib or z3c.form to model forms.
Widget/form generation and validation is basically kind of build-in and can be customized as needed.
不,Zope 2 不支持 WSGI 中间件,至少不是开箱即用的。
您可以尝试看看 repoze.zope2 是否适合您的用例,因为它将 WSGI 管道固定在 Zope 之上2. 请注意,该软件包的开发于 2009 年停止,最后发布的版本仅支持 Zope 2.10。 YMMV。
我怀疑您的用例可能会以其他方式得到满足,但您没有提供足够的详细信息来帮助我们。
No, Zope 2 does not support WSGI middleware, at least, not out of the box.
You could try and see if repoze.zope2 works for your use-case, as that bolts a WSGI pipeline on top of Zope 2. Note that development for that package stopped in 2009, and the last released version only supports Zope 2.10. YMMV.
I suspect that your use-cases may be satisfied in other ways though, but you don't provide enough detail for us to help you.