使用Python的Web服务器 [英] Web server with Python

查看:76
本文介绍了使用Python的Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在我尝试使用mod_python和Python运行Apache 2失败之后

2.3,我正在寻找另一种方法。

我的目标是编写一个基于Web的小应用程序:


Python

- 解决方案必须基于/可用于Python 2.3


便携性

目标平台是

- Windows 2000 Server

- Windows XP专业版

- AIX 5.1

网络服务器:

- 支持多达50个并发客户端连接

- 必须能够使用Python 2.3创建动态页面

我可以想到Apache的3种替代方案:

- 美杜莎

- 扭曲

- Zope

哪一个最容易合作?例如,哪一个可以在

AIX 5.1平台上工作?

持久存储

- ZODB是否易于使用来自Python之外,即生成报告

而不回复编程?

- MySQL与Python的组合是否很好?

问候,

-PU

Hi all,
after my unsuccessful try to run Apache 2 with mod_python and Python
2.3, I am looking for an alternative approach.
My aim is to write a small web-based application:

Python
- the solution must be based / usable on Python 2.3

Portability
Targeted plaforms are
- Windows 2000 Server
- Windows XP Pro
- AIX 5.1

Webserver:
- supporting up to 50 concurrent client connections
- must be able to use Python 2.3 to create dynamic pages
I can think of 3 alternatives to Apache:
- Medusa
- Twisted
- Zope
Which one is the easiest to work with? Which one is known to work on an
AIX 5.1 platform, for instance?

Persistent storage
- Is ZODB easily usable from outside Python, i.e. to produce reports
without reverting to programming?
- Is MySQL with Python a good combination?
Regards,
-PU

推荐答案



" Patrick Useldinger" < P ********** @ myrealbox.com>在消息中写道

news:tn ******************************** @ 4ax.com ...

"Patrick Useldinger" <p.**********@myrealbox.com> wrote in message
news:tn********************************@4ax.com...
大家好,
在我尝试使用mod_python和Python运行Apache 2后,
2.3,我正在寻找另一种方法。
我的目标是编写一个基于Web的小应用程序:

Python
- 解决方案必须基于/可用于Python 2.3

可移植性
目标平台是
- Windows 2000 Server
- Windows XP Pro
- AIX 5.1

Webserver:
- 支持多达50个并发客户端连接
- 必须能够使用Python 2.3来创建动态页面
我可以想到Apache的3种替代方案:
- 美杜莎
- 扭曲
- Zope
哪一个是最容易使用?例如,哪一个在AIX 5.1平台上工作?


我曾与Zope,Medusa和Twisted合作过。如果您可以在资源和类似情况下使用
www.zope.org 上的任何内容要在网页上做所有事情,而不是自己做大量的编程,那么Zope可能就是这样。它涵盖了

python代码,有点像我的口味(有点低调)。


美杜莎很容易使用,但我有阻止和

表格处理(主要是发布的文件等)的一些问题,但它可能是我当时缺乏理解的



如果您远离Woven并且自己使用资源级别,那么Twisted很容易掌握。如果你喜欢
,我可以制作一个非常简单的例子。我觉得Twisted在某些方面有一个非常陡峭的学习曲线,而且项目确实有正在建设中的感觉,但是

开发者/邮件列表非常友好和乐于助人,很高兴投入。


我在AIX上没有做任何事情所以我对可移植性一无所知。

如果你想要控制,我会选择Twisted,如果你可以使用任何现有的产品,那么我会选择Zope产品"可以在zope上获得。

持久存储
- ZODB是否可以从外部Python轻松使用,即生成报告而不需要恢复编程?
- MySQL是否与Python一致好的组合?
Hi all,
after my unsuccessful try to run Apache 2 with mod_python and Python
2.3, I am looking for an alternative approach.
My aim is to write a small web-based application:

Python
- the solution must be based / usable on Python 2.3

Portability
Targeted plaforms are
- Windows 2000 Server
- Windows XP Pro
- AIX 5.1

Webserver:
- supporting up to 50 concurrent client connections
- must be able to use Python 2.3 to create dynamic pages
I can think of 3 alternatives to Apache:
- Medusa
- Twisted
- Zope
Which one is the easiest to work with? Which one is known to work on an
AIX 5.1 platform, for instance?
I''ve worked with Zope, Medusa and Twisted. If you can use anything found on
www.zope.org under resource and like to do everything in a webpage, not
doing much programming yourself, then Zope might be the thing. It covers the
python-code a bit much for my taste ( a bit being a huge understatement ).

Medusa is easy to work with but I had some problems with blocking and
form-handling ( mainly posted files etc. ) but it might have been my lack of
understanding back then.

Twisted is very easy to get a grip on if you stay away from Woven and use
the resource-class yourself. I can produce a very simple example if you
like. I find Twisted to have a very steep learning curve in some areas and
the project do have a feeling being "under construction", but the
developers/mailing-list are very friendly and helpful and glad for input.

I haven''t done anything on AIX so I don''t know anything about portability.
I''d go for Twisted if you want control, Zope if you can use any existing
"product" available at zope.

Persistent storage
- Is ZODB easily usable from outside Python, i.e. to produce reports
without reverting to programming?
- Is MySQL with Python a good combination?




MySQL很容易使用Python,所以是的。我在ZODB的经历是

不太好。我在编译它的早期版本时遇到了问题(可能是我的

故障但仍然存在)并且我很快发现我需要SQL才能够以b
存储和检索数据的方式我想了。如果你的MySQL太多了,你可以看看SQLite,它有一个python模块,易于安装/分发,而且它是一个真实的。 sql-database,即。它可以理解SQL,感觉就像一个

的SQL数据库。


Thomas W



MySQL is easy to work with using Python, so yes. My experience with ZODB has
not been good. I had problems compiling earlier version of it ( probably my
fault but still ) and I quickly found out that I needed SQL to be able to
store and retrieve data the way I wanted. If MySQL is too much for you take
a look at SQLite, it has a python-module and easy to install/distribute and
it is a "real" sql-database, ie. it can understand SQL and feels like a
SQL-database.

Thomas W


Thomas Weholt写道:
Thomas Weholt wrote:
- 必须能够使用Python 2.3创建动态页面
如果你可以使用 www.zope.org
喜欢在网页上做所有事情,没有做太多编程
你自己,那么Zope可能就是这样。
- must be able to use Python 2.3 to create dynamic pages
If you can use anything found on www.zope.org under resource and
like to do everything in a webpage, not doing much programming
yourself, then Zope might be the thing.




然而,Zope仍然没有在Python 2.3上运行,是吗?

// Klaus


- <>无私的行动回报更好



However, Zope still doesn''t run on Python 2.3, does it?
// Klaus

--<> unselfish actions pay back better



Thomas Weholt写道:


[snip]
Thomas Weholt wrote:

[snip]

如果你远离Woven并且自己使用资源类,扭曲很容易掌握。如果你愿意,我可以制作一个非常简单的例子。我觉得Twisted在某些领域有一个非常陡峭的学习曲线,而且项目确实有建筑施工的感觉,但开发者/邮件列表非常友好
乐于助人并乐意投入。


Twisted邮件列表已经停止了几天。他们是'b $ b'移动。


要获得扭曲,请检查:

http://www.twistedmatrix.com/

我同意有关的积极评论Twisted。


Twisted文档似乎相当不错且相当广泛。

而且,对于Web应用程序,这里有一个我写的文件

可能会帮助您入门:

http://www.rexx.com/~dkuhlman/twisted_pa​​tterns.html

我自己仔细检查了这份文件,但还没有已经

能够让任何Twisted专家对其进行审核(再次,电子邮件

列表暂时停止),所以读者要小心。
<顺便说一下,Twisted不仅仅是Web应用程序。


[snip]

MySQL很容易使用Python ,是的。我与ZODB的经历并不好。我在编译它的早期版本时遇到了问题(可能是我的错,但仍然),我很快发现我需要SQL才能以我想要的方式存储和检索数据。如果MySQL太多了你看看SQLite,它有一个python模块,易于安装/分发,它是一个
真实的。 sql-database,即。它可以理解SQL并感觉像是一个SQL数据库。

Twisted is very easy to get a grip on if you stay away from Woven
and use the resource-class yourself. I can produce a very simple
example if you like. I find Twisted to have a very steep learning
curve in some areas and the project do have a feeling being "under
construction", but the developers/mailing-list are very friendly
and helpful and glad for input.
The Twisted mailing list has been down for a few days. They''re
moving.

To get Twisted, check:

http://www.twistedmatrix.com/

I agree with the positive comments about Twisted.

The Twisted documentation seems pretty good and fairly extensive.
And, for Web applications, here is a document I''ve written that
might help you to get started:

http://www.rexx.com/~dkuhlman/twisted_patterns.html

I''ve checked this document carefully myself, but have not yet been
able to get any Twisted experts to review it yet (again, the email
list is down temporarily), so "reader beware".

Twisted is more than Web apps, by the way.

[snip]
MySQL is easy to work with using Python, so yes. My experience
with ZODB has not been good. I had problems compiling earlier
version of it ( probably my fault but still ) and I quickly found
out that I needed SQL to be able to store and retrieve data the
way I wanted. If MySQL is too much for you take a look at SQLite,
it has a python-module and easy to install/distribute and it is a
"real" sql-database, ie. it can understand SQL and feels like a
SQL-database.




(如上所述)有关使用PostgreSQL(或其他

关系数据库,稍作修改)与Twisted的代码示例。


Dave


-

Dave Kuhlman
http://www.rexx.com/~dkuhlman
dk ****** @ rexx.com


这篇关于使用Python的Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆