决定为新的 Web 应用程序使用 WSGI 还是 Django

发布于 2024-12-12 09:44:08 字数 412 浏览 7 评论 0原文

我正在设置一个新的 Web 应用程序,并决定是使用 WSGI 还是使用 Django 进行完整的框架路线。

该应用程序最重要的要求:

1) 该应用程序没有任何 UI,所有数据都通过带有 JSON 的 REST api 公开给客户端。

2) 它将有数据来持久保存,因此 MongoDB 和数据库方面可能会使用Amazon的SimpleDB。

是否有使用 Django 的理由,或者仅使用 WSGI 可以获得边际速度提升?

我以前构建的服务器端应用程序是在 JVM 上使用 Java/Struts 和 Groovy/Grails 构建的。我的理解是Django是一个类似于Rails和Grails的MVC框架。

我还尝试过 Google App Engine,它使用 WSGI 作为代码之上的薄层来管理和路由请求。

I'm in the process of setting up a new web app and deciding whether to just do it with WSGI or go the full framework route with Django.

The app's foremost requirements:

1) The app has no UI what so ever and all of the data is exposed to clients via a REST api with JSON.

2) It will have data to persist so MongoDB & probably Amazon's SimpleDB will be used for the database side.

Is there a reason to use Django or can I get marginal speed improvement with WSGI only?

Previous server-side apps I've built were either with Java/Struts and Groovy/Grails on the JVM. My understanding is that Django is an MVC framework similar to Rails and Grails.

I've also played around with Google App Engine which uses WSGI as thin layer above your code for managing and routing requests.

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

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

发布评论

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

评论(3

稚气少女 2024-12-19 09:44:08

我建议你考虑一下这两个极端之间的事情。 Flask 是轻量级的,非常易于使用,并通过 wsgi 连接到您的 Web 服务器。您可以使用常规的 python 数据库连接器,一些数据库甚至具有 Flask 特定的 扩展模块。

I suggest you consider something between those two extremes. Flask is lightweight, very easy to use, and connects to your web server via wsgi. You can use regular python database connectors with it, and a few databases even have Flask-specific extension modules.

我ぃ本無心為│何有愛 2024-12-19 09:44:08

我已经使用 Django 完成了几个项目,我非常喜欢它,但是由于您将使用 mongoDB 和大量 JSON 我建议您使用 >NodeJS作为服务器端,以Express作为框架,您可以在这里看到一个简短的教程:

http://howtonode.org/express-mongodb

这样做的优点之一是,您将在整个项目中仅使用 javascript,我开始使用上个月在黑客马拉松中介绍了这项技术,我可以告诉你,它的快速和简单给我留下了深刻的印象。

I have worked with Django for a couple of projects and I like it a lot, but since you are going to use mongoDB and a lot of JSON I suggest you use NodeJS as server side, with Express as framework, you can see a brief tutorial here:

http://howtonode.org/express-mongodb

One of the advantages of this is that you will use only javascript all along your project, I began working with this technology the last month in a Hackathon, and I can tell you that I'm very impressed of how fast and simple it is.

兔小萌 2024-12-19 09:44:08

我使用过一些 django“应用程序”,它确实很简单,但是设置“应用程序”可能是一个有点漫长的过程。 Django 有很多不错的功能,但您不会使用它们,我同意您可能会处于一种“极端”状态。

I've worked a bit with some django "apps" ,its really easy, but setting up the "apps" can be a bit of a long process. Django has a lot of nice features that you won't be using and I agree that you might be on one "extreme" here.

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