适用于 python 3.1 用户的 Python Web 开发框架

发布于 2024-08-27 02:35:05 字数 481 浏览 4 评论 0原文

我已经学习Python有一段时间了。在开始“学习 python”努力时,我决定学习最新最好的 3.1 版本的 python。我现在后悔这个决定,因为我想尝试一些Python Web开发框架和应用程序。看起来他们中的许多人还不支持 3.1 &看起来他们可能需要数年时间才能支持新版本的Python,尤其是 DjangoTurboGears。这实在令人失望。因此,SO 用户,您对我有什么建议,可以在 3.1 上运行并支持一些现代(我想我永远不会学习;-))Web 框架功能,如 MVC/ORM/URL 路由/缓存等 Web 框架。

I have been learning python for some time now. While starting this "learning python" endeavor I decided to learn the latest and greatest 3.1 version of python. I regret this decision now because I wanted to try my hands on some of the python web development frameworks & it looks like many of them do not support 3.1 yet & it looks like it might take them years to support the new version of Python especially Django and TurboGears. This is really disappointing. Therefore, SO users, do you have any recommendation for a web framework for me that runs on 3.1 and supports some of the modern (I guess I will never learn ;-)) web framework features like MVC/ORM/URL Routing/Caching etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

素染倾城色 2024-09-03 02:35:06

实际上有一个 Django 移植到 Py3k。

http://bitbucket.org/loewis/django-3k/

我还记得很清楚很高兴在 django-developers 邮件列表上阅读了有关将 Django 移植到 py3k 的大学项目的帖子,但我目前找不到该帖子。

编辑
哦,这是:

https://bitbucket.org/fiji/django-3k/

该项目由多伦多大学的学生领导。 :-)

ENDEDIT

查询“Django py3k port”之类的内容会带来一些有用的结果。

另请查看这些 URL:

  • http://wiki.python.org/moin/PortingDjangoTo3k
  • < a href="http://groups.google.com/group/django-developers/browse_thread/thread/bf9d8808ee5aadb4/ccceb8901addceff?lnk=gst&q=django++port+py3k#ccceb8901addceff" rel="nofollow noreferrer"> http://groups.google.com/group/django-developers/browse_thread/thread/bf9d8808ee5aadb4/ccceb8901addceff?lnk=gst&q=django++port+py3k#ccceb8901addceff

There is ( are) actually a Django port to Py3k.

http://bitbucket.org/loewis/django-3k/

I can also remember quite good of having read a thread about a University project of porting Django to py3k, on the django-developers mailing-list, but I can't find the thread at the moment.

EDIT
Oh here it is:

https://bitbucket.org/fiji/django-3k/

The project is lead by students at the University of Toronto. :-)

ENDEDIT

Querying for something like "Django py3k port" brings up some useful results.

Also look at these URLs:

对不⑦ 2024-09-03 02:35:05

尝试 Python2.7 怎么样?,许多 python 3.x 功能都是最近向后移植到 2.7,如 OrderedDict、更快的 io 模块、集合推导式、字典推导式等...

根据我的经验,Python 2.7 在 django 1.2 主干版本上运行完全没有问题。

在我看来,学习新框架比从Python2.x切换到Python3.x需要更多时间,所以选择一个框架,继续使用python 2.x,到时候再切换到3.x。

How about trying Python2.7?, many of python 3.x features are backported to 2.7 recently, like OrderedDict, faster io modules, set comprehensions, dict comprehensions, etc...

And Python 2.7 is running no problem at all with django 1.2 trunk version in my experience.

In my opinion, learning new framework will take more time than switching from Python2.x to Python3.x, So choose one framework, and just keep using python 2.x and switch it to 3.x when the time come.

月寒剑心 2024-09-03 02:35:05

与其他人一样,我建议您从 Python 2.6.x 开始 - Python 2.7 将于今年夏天发布,尽管您今天可以获取 alpha 或 beta 版本。

虽然 Python 3.x 与 2.x 向后不兼容,但 Python 语法不会无法识别...几乎一切都与 2.x 非常相似,但是当 时很容易破坏代码print 从语句变为函数。所以现在不用担心 Python 3。正如其他人提到的,您可以立即开始使用大量在 Python 2.x 中工作的 Web 框架。

另外,不要仅仅因为编号就认为 Python 2 已经过时了,也不要按顺序遵循时间线。换句话说,Python 2.7 将比 Python 3.0 和 3.1 更新。 (3.2 直到今年年底才会发布。)同样,Python 2 还没有停产——2.x 和 3.x 都在积极开发中。

工业世界仍然运行在 Python 2.x 上; 3.x的出现提醒我们下一代已经到来,所有底层基础设施和框架都应该开始移植工作,以便我们最终都能迁移。

如果你想了解更多关于Python 2、Python 3之间的关系,以及两者之间的变化/差异以及时间线和迁移,你可以查看我今年早些时候写的这篇在线文章:

《Python 3:编程语言的演变》
http://www.informit.com/articles/article.aspx?p= 1328795

我还在 2 月份的 PyCon 2010 上就同一主题发表了演讲。您可以在此处访问视频和幻灯片预览:
http://us.pycon.org/2010/conference/schedule/event /29/

Like the others, I would suggest you start with Python 2.6.x -- Python 2.7 will be released this summer although you can grab an alpha or beta version today.

Although Python 3.x is backwards-incompatible with 2.x, Python syntax isn't going to be unrecognizable... pretty much everything is very similar to 2.x, but it's easy to break code when print changes from a statement to a function. So don't worry about Python 3 for now. As others have mentioned, you can get started right away with plenty of web frameworks that work in Python 2.x.

Also, just because of the numbering, do NOT be fooled in thinking that Python 2 is obsolete in any way nor can you follow the timeline serially. In other words, Python 2.7 will be newer than both Python 3.0 and 3.1. (3.2 won't be released until the end of this year.) Again, Python 2 has NOT been EOL'd -- both 2.x and 3.x are being developed actively.

The industrial world still runs on Python 2.x; the appearance of 3.x is a reminder that the next generation is here, and this is the time that all of the lower-level infrastructure and frameworks should begin their porting work so that we'll all eventually migrate.

If you want to find out more about the relationships between Python 2, Python 3, and the changes/differences between the two as well as the timeline and migration, you can check out this online article I wrote earlier this year:

"Python 3: The Evolution of a Programming Language"
http://www.informit.com/articles/article.aspx?p=1328795

I also gave a talk on this same subject at PyCon 2010 in February. You can access the video and the slide preso here:
http://us.pycon.org/2010/conference/schedule/event/29/

溺孤伤于心 2024-09-03 02:35:05

CherryPy 3.2(仍在开发中)将在 Python 3.x 上运行

Bottle 在使用 2to3 后也可以在 Python 3.x 上运行。很容易做而且确实有效。然而,Bottle 并不是一个“完整的框架”,但它很容易使用。

编辑:

我在 Python 3.1 中使用 Bottle,具体来说是 stackless python 3.1,用于我正在慢慢开发的游戏。但在工作中,我只使用 Python 2.6,很快我就会使用 Webpy。

我工作的网站是用 PHP 编写的,但是当我需要添加一个新功能时,我可以轻松地将其与所有 PHP 代码分开,我将用 python 来完成。尽管我几乎每天都使用 PHP,每个月只使用几次 Python,但我仍然可以用 Python 比 PHP 更快地完成工作:)

CherryPy 3.2 (still being worked on) will run on Python 3.x

Bottle can also run on Python 3.x after using 2to3 on it. Easy to do and it does work. However, Bottle is not a 'complete framework' but it is easy to use.

Edit:

I have used Bottle in Python 3.1, stackless python 3.1 to be specific, for a game that I am slowly working on. But at work, I am just using Python 2.6 And soon I will be using Webpy.

The site I work on is in PHP, but when I need to add a new feature, that I can easily separate from all the PHP code, I will do it in python. Even though I work with PHP almost everyday and use Python only a few times a month, I still can get things done faster in Python than PHP :)

债姬 2024-09-03 02:35:05

Python 2.6 和 Python 3.1 实际上并没有那么不同,我只是建议您学习两者,特别是因为 Python 的两个分支将共存一段时间......所以最好只学习细微的差异。文档“Python 3.0 的新增功能”解释了大部分内容2.6和3.0之间的区别。

Python 2.6 and Python 3.1 are really not all that different, I simply suggest you learn both, especially since both branches of Python are going to coexist for a while... so best to just learn the slight differences. The document "What's New in Python 3.0" explains most of the differences between 2.6 and 3.0.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文