为什么要在 Google App Engine 上使用 Django? [英] Why use Django on Google App Engine?

查看:26
本文介绍了为什么要在 Google App Engine 上使用 Django?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在研究 Google App Engine (GAE) 时,很明显,在 GAE 上使用 Python 进行开发时,使用 Django 非常流行.我一直在网上搜索有关使用 Django 的成本和收益的信息,以了解 为什么它如此受欢迎.虽然我已经能够找到关于如何在 GAE 上运行 Django 的各种来源以及这样做的各种方法,但我还没有找到任何关于为什么的比较分析em> Django 比使用 Google 提供的 webapp 框架更可取.

When researching Google App Engine (GAE), it's clear that using Django is wildly popular for developing in Python on GAE. I've been scouring the web to find information on the costs and benefits of using Django, to find out why it's so popular. While I've been able to find a wide variety of sources on how to run Django on GAE and the various methods of doing so, I haven't found any comparative analysis on why Django is preferable to using the webapp framework provided by Google.

需要明确的是,为什么在 GAE 上使用 Django 对具有 Django 现有技能集的开发人员(毫无疑问,大多数 Python Web 开发人员)或在 Django 中使用现有代码(使用 GAE 更像是一种移植)很有用是显而易见的锻炼).然而,我的团队正在评估 GAE 以用于一个全新的项目,我们现有的经验是使用 TurboGears,而不是 Django.

To be clear, it's immediately apparent why using Django on GAE is useful for developers with an existing skillset in Django (a majority of Python web developers, no doubt) or existing code in Django (where using GAE is more of a porting exercise). My team, however, is evaluating GAE for use on an all-new project and our existing experience is with TurboGears, not Django.

当 BigTable 库取代了 Django 的 ORM、会话和身份验证必须改变,并且 Django 的模板(如果需要)可以在不使用整个 Django 堆栈的情况下使用时,很难确定为什么 Django 对开发团队有益.

It's been quite difficult to determine why Django is beneficial to a development team when the BigTable libraries have replaced Django's ORM, sessions and authentication are necessarily changed, and Django's templating (if desirable) is available without using the entire Django stack.

最后,很明显,如果我们以后想要摆脱 GAE 并需要一个平台来应对外流,那么使用 Django 确实具有提供退出策略"的优势.

Finally, it's clear that using Django does have the advantage of providing an "exit strategy" if we later wanted to move away from GAE and need a platform to target for the exodus.

我非常感谢您帮助指出为什么在 GAE 上使用 Django 比使用 webapp 更好.我对 Django 也完全没有经验,因此详细说明适用于 GAE 的较小功能和/或便利对我来说也很有价值.

I'd be extremely appreciative for help in pointing out why using Django is better than using webapp on GAE. I'm also completely inexperienced with Django, so elaboration on smaller features and/or conveniences that work on GAE are also valuable to me.

推荐答案

我们在 appengine 实例上使用 django,主要是当我们必须向用户提供实际网站时.它有一个很棒的模板引擎、url 路由和所有内置的请求/响应/错误处理.所以即使我们不能使用神奇的 orm/admin 东西,它也有很多用处.

We use django on our appengine instances mostly when we have to serve actual websites to the user. It has a great template engine, url routing and all the request/response/error handling built in. So even while we can't use the magic orm/admin stuff it has a lot going for it.

对于 api 服务,我们在 webob 之上构建了一些非常简单的东西.它要轻得多,因为它不需要 django 提供的所有东西,因此在某些情况下速度更快.

For api services we built something very simple on top of webob. It's far more lightweight because it doesn't need everything that django offers, and therefore a little quicker in some situations.

这篇关于为什么要在 Google App Engine 上使用 Django?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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