Django、Turbo Gears、Web2Py,哪个更好?

发布于 09-18 11:30 字数 943 浏览 10 评论 0原文

我心中有了一个项目,值得我最终投身于编程。

在阅读了这里和其他地方的大量内容之后,我决定让 Python 成为我现在学习的语言,而不是 C# 或 java。最让我信服的其实是 Paul Graham 对编程语言和 Lisp 的探索,尽管 Arc 还处于实验阶段,这对我现在做这个 Web 应用程序没有帮助。

至于快速的网络应用程序,我已经检查过 Django、Turbo Gears 和 Py2Web。尽管花了很多时间阅读,我仍然不知道应该使用哪一本。

1) Django 当然拥有最好的在线形象,以及做得很好的现场教程,他们肯定知道如何炫耀他们的东西。

2) Web2Py 因其无需安装以及声称使 Django 看起来复杂而吸引了我。但是当你在他们的网站上挖掘时,你很快就会发现多年来没有更新的内容,并且外部链接已损坏......该网站上有鬼魂,让不熟悉该项目的人担心它是否会趋于平淡。

3) 涡轮齿轮 ...我猜它也是模块化的。写关于它的人喜欢它......我找不到任何具体的东西可能使它比 Django 更特别。

我还没有决定使用 IDE,尽管我在这里阅读了 Intellisense 代码完成帖子的所有答案。对于像我这样的菜鸟来说,显示额外的代码片段也很酷,但我想我应该首先选择我的网络框架工作,然后选择一个可以很好地使用它的编辑器。

由于可能没有一个框架在所有方面都是最好的,因此我将给出我想要构建的应用程序的一些细节:

它将使用 MySQL,需要注册/登录,并且会对数据进行大量简单的数学运算来自输入和 SQL 查询。我已经在 Excel 中完成了一个功能原型,所以我确切地知道我想要构建什么,我希望这能帮助我克服我的笨蛋。我将是一个小应用程序,没什么大的。

而且我不想在构建它时看到任何 HTML ;-)

PS:感谢运行 Stackoverflow 的人们,也在正确的时刻找到了这个地方!

I got a project in mind that makes it worth to finally take the plunge into programming.

After reading a lot of stuff, here and elsewhere, I'm set on making Python the one I learn for now, over C# or java. What convinced me the most was actually Paul Graham's excursions on programming languages and Lisp, though Arc is in the experimental stage, which wouldn't help me do this web app right now.

As for web app fast, I've checked out Django, Turbo Gears and Py2Web. In spite of spending a lot of time reading, I still have no clue which one I should use.

1) Django certainly has the nicest online presence, and a nicely done onsite tutorial, they sure know how to show off their thing.

2) Web2Py attracted me with its no-install-needed and the claim of making Django look complicated. But when you dig around on their website, you quickly find content that hasn't been updated in years with broken external links... There's ghosts on that website that make someone not intimately familiar with the project worry if it might be flatlining.

3) Turbo Gears ...I guess its modular too. People who wrote about it loved it... I couldn't find anything specific that might make it special over Django.

I haven't decided on an IDE yet, though I read all the answers to the Intellisense code completion post here. Showing extra code snippets would be cool too for noobs like me, but I suppose I should choose my web frame work first and then pick an editor that will work well with it.

Since probably no framework is hands down the best at everything, I will give some specifics on the app I want to build:

It will use MySQL, it needs register/sign-in, and there will be a load of simple math operations on data from input and SQL queries. I've completed a functional prototype in Excel, so I know exactly what I want to build, which I hope will help me overcome my noobness. I'll be a small app, nothing big.

And I don't want to see any HTML while building it ;-)

PS: thanks to the people running Stackoverflow, found this place just at the right moment too!

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

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

发布评论

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

评论(7

迷荒2024-09-25 11:30:23

您应该查看 web2py 在线文档 (http://web2py.com/book)。它配备了基于角色的访问控制(最通用的访问控制机制),并且非常精细,您可以授予对特定记录的特定操作的访问权限。它附带了一个基于 Web 的 IDE,但您可以使用 WingIDEEclipsePyCharm 也是如此。它配备了帮助系统,允许您在不使用 HTML 的情况下生成 HTML。下面是一个完整的应用程序示例,需要用户注册/登录/发布消息:

db.define_table('message',Field('body'),Field('author',db.auth_user))
@auth.requires_login()
def index():
    db.message.author.default=auth.user.id
    db.message.author.writable=False
    return dict(form=crud.create(db.message),
                messages=db(db.message.id>0).select())

web2py 项目非常活跃,您可以从更改列表中看到 http://code.google.com/p/web2py/source/list

如果您有与 web2py 相关的问题,我强烈建议您加入 web2py 邮件列表:
http://groups.google.com/group/web2py/topics

我们非常积极主动,您的问题将很快得到解答。

You should look at the web2py online documentation (http://web2py.com/book). It comes with a Role Based Access Control (the most general access control mechanism) and it is very granular, you can grant access for specific operation on specific records. It comes with a web based IDE but you can use WingIDE, Eclipse and PyCharm too. It comes with helper system that allows you to generate HTML without using HTML. Here is an example of a complete app that requires users to register/login/post messages:

db.define_table('message',Field('body'),Field('author',db.auth_user))
@auth.requires_login()
def index():
    db.message.author.default=auth.user.id
    db.message.author.writable=False
    return dict(form=crud.create(db.message),
                messages=db(db.message.id>0).select())

The web2py project is very active as you can see from the list of changes http://code.google.com/p/web2py/source/list

If you have web2py related questions I strongly suggest you join the web2py mailing list:
http://groups.google.com/group/web2py/topics

We are very active and your questions will be answered very quickly.

永言不败2024-09-25 11:30:23

我不得不说,作为一个不是特别熟练的开发人员,我使用 web2py 进行创建的速度让我大吃一惊。很大程度上归功于令人惊叹的社区和 Massimo 使框架易于访问的核心价值。

当我开始时,我用 Python 编写了 0 行代码
从来没有听说过 web2py

我已经认真研究了大约一个月,并且已经(以我通常的方式)从提出没人能回答的问题(因为它们没有任何意义)发展到一次编码几个小时而没有任何问题拿起一本书或问一个问题。

我真的很感动。

I have to say as not particularly skilled developer, the speed at which I have been able to create using web2py has blown my mind. In large part due to the amazing community and the core value Massimo has of making the framework accessible.

When I started I had written 0 lines of code in Python
Never heard of web2py

I've been at it seriously for about a month and have progressed (in my usual fashion) from asking questions that no one could answer (because they didn't make any sense) to coding for hours at a time without picking up a book or asking a question.

I'm really impressed.

我对 Django 有过积极的经历。

  • 内置身份验证和易于使用的注册扩展
  • 非常好的文档
  • 您可能主要在 base.html 中编写 HTML 模板,然后只需使用模板继承(注意:您至少需要编写一点 HTML)
  • 与 Turbogears 相比,Django更“开箱即用”
  • 我对 web2py 没有任何经验,但从我的印象来看,它试图做一些“开箱即用”的事情

I've had positive experiences with Django.

  • Built-In Authentication and easy to use extensions for registration
  • Very good documentation
  • You probable write your HTML templates mostly in base.html, then just use template inheritance (Note: You'll need to write at least a little bit of HTML)
  • In contrast to Turbogears, Django is more 'out-of-the-box'
  • I don't have any experience with web2py, but from my impression, it tries to do a little to much 'out-of-the-box'
岁月苍老的讽刺2024-09-25 11:30:23

如果您决定使用 Django,请确保使用它的通用视图。它们将使您免于编写大量代码(Python 和 HTML)。

另外,除非有非常具体的原因让您使用 MySQL,否则我建议您切换到 PostgreSQL。 Django 更面向 PostgreSQL,无论如何它都是一个更好的数据库。

Django 在线文档很棒,这就是它与所有其他框架的不同之处。我还推荐 James Bennett 的实用 Django 项目一书

If you decide to go with Django, make sure that you use its Generic Views. They will save you from writing lots of code, both Python and HTML.

Also, unless there is a very specific reason for you to use MySQL, I advise you to switch to PostgreSQL. Django is much more oriented towards PostgreSQL and it's a much better database anyway.

The online Django documentation is great, this is what put it apart from all the other frameworks. I also recommend the book Practical Django Projects by James Bennett

  • Django:听说它有最好的管理
    界面。但使用它自己的 ORM,即不使用 SQL-Alchemy。

  • Web2py:没有研究这个。

  • 涡轮齿轮2:
    默认使用 SQL-Alchemy,使用 Catwalk 进行管理
    界面,但文档不一样
    伟大的。

我选择 Turbogears2 因为它使用流行的组件,所以我不需要学习任何新的东西......

  • Django: Heard it has the best administrative
    interface. But uses it's own ORM, i.e. doesn't use SQL-Alchemy.

  • Web2py: Didn't research this.

  • Turbogears2:
    Uses SQL-Alchemy by default, uses Catwalk for admin
    interface, but documentation isn't as
    great.

I chose Turbogears2 because it uses popular components, so I didn't have to learn anything new...

风铃鹿2024-09-25 11:30:23

我广泛使用了 web2py 和 RoR,虽然 RoR 在过去几年中得到了很大的流行和支持,但 web2py 更简单、更干净、不那么“神奇”,而且还提供了更多(有用的)out-of-开箱即用的功能。我想说web2py比RoR更有潜力,但它是一个相对较新的框架,还没有RoR成熟。 (尽管如此,我随时都会选择 web2py 而不是 RoR...)

I've used both web2py and RoR extensively, and while RoR has gotten a lot of popularity and support in the past few years, web2py is simpler, cleaner, less "magical", and yet also offers more (useful) out-of-the-box functionality. I'd say that web2py has more potential than RoR, but it is a relatively new framework and does yet not have the maturity of RoR. (Despite that, though, I'd choose web2py over RoR any day...)

你爱我像她2024-09-25 11:30:23

如果您“不想在构建时看到任何 HTML”,那么您可以忘记 Django。它并不专注于“点击完成”,而是专注于在尽可能短的时间内从概念到生产的专业人士。模板语言的分层性质可以导致一些非常干净的整体站点布局。我所有的大型网站都使用 Django,而且我很喜欢它。

虽然它是用 PHP 编写的,而不是 Python,但您可能会看一下 WordPress 的主要新版本,该版本的发布内容为两三个月前。在 3.0 中,它们已经从“仅限博客”环境走了很长一段路,并且有大量现成的模板。当然,如果您想调整模板,那么,又会出现令人讨厌的旧 HTML。我正在考虑将它用于我的小型客户,这些客户无法处理专用服务器的管理等,而这些服务器往往带有 Django 站点。

更新:
啊,我错过了那个半笑话——我起得太早了,这往往让我对幽默充耳不闻。就使用现有站点中的模板而言,我已经在几个站点上非常成功地做到了这一点,其中包括静态站点和最初由编写良好的 PHP 脚本驱动的站点。我建议仔细阅读 { % 扩展 %}{% include %} 文档。两者都采用字符串文字变量。我使用了后一种方法,对于具有很强的层次结构(以跨分支的样式更改为特征)的网站来说,它非常有用。

花时间了解模板的搜索顺序也是值得的——它可以起到很好的效果,但如果你不理解它,它可能会令人困惑。请参阅 设置中与模板相关的项目.py 文件以获得此和其他有用的东西。

If you "don't want to see any HTML while building it" then you can forget Django. It is not focused on "point-click-done," it is focused on pros going from concept to production in the shortest time possible. The hierarchical nature of the templating language can lead to some very clean overall site layouts. I use Django for all of my larger sites and I love it.

Although it's written in PHP, not Python, you might take a look at the major new version of WordPress that came out about 2 or 3 months ago. In 3.0 they have come a long way from being a "blogs only" environment and there are tons of ready-made templates for it. Of course if you want to tweak a template, well, there's that nasty old HTML again. I am considering using it for my smaller clients that can't deal with the admin of a dedicated server, etc., that tends to come with a Django site.

Update:
Ah, I missed the semi-joke -- I was up too early and that tends to make me tone deaf to humor. As far as using templates from existing sites, I have done this quite successfully with a couple of sites, both those that were static and those originally driven by well-written PHP scripts. I recommend a careful reading of the {% extends %} and {% include %} docs. Both take either a string literal or a variable. I have used the later method and it can be quite useful for a site that has strong hierarchy distinguished by style changes across branches.

It is also worth the time to understand the search order for templates -- it can be used to good effect, but it can be puzzling if you don't grok it. See the template-related items in the settings.py file for this and other useful goodies.

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