GAE Webapp 还是 Django-nonrel?

发布于 2024-11-27 04:41:22 字数 554 浏览 1 评论 0原文

我想托管我的个人网站,该网站主要有博客、图库组件以及代码片段和演示。我选择 GAE 是因为它为规模合理的网站(即个人网站)提供免费托管。

我最初认为它可以在不进行任何修改的情况下托管 Django 应用程序,并且由于我在 Django 方面有一些经验,因此我可以轻松部署站点。然而,经过进一步研究,我发现情况并非如此,它需要一些“技巧”才能在 GAE 上托管 Django 站点。

此外,在查看了一些 Web 应用程序的实现后,似乎 GAE 可能要简单得多,并且不像文档中所描述的那样令人畏惧:https://github.com/ccarpenterg/todolist/wiki

所以我的问题是:

  • 使用 Django 比 GAE Webapps 有什么好处吗?
  • 如果存在管理成本的话,这些好处值得吗?
  • 我是否正确地认为 GAE Web 应用程序的学习曲线可以忽略不计,并且可能比 Django 应用程序更容易实现?

I want to host my personal site which will mainly have a blog, gallery component as well as code snippets and demos.I've chosen GAE because it offers free hosting for a reasonably scaled website(i.e. personal sites).

I initially thought it could host Django applications without any modifications and since I have some experience in Django it'd be easy for me to deploy a site. However, upon further research I discovered that this was not the case and it requires some "hacks" to host a Django site on GAE.

Additionally, upon looking at a few implementations of webapps it seems that GAE is probably a lot simpler and not as daunting as the documentation made it out to be: https://github.com/ccarpenterg/todolist/wiki

So my questions are these:

  • Is there any benefit to using Django over GAE Webapps?
  • Are the benefits worth the overhead cost - if there is even an overhead cost?
  • Am I correct in thinking that GAE Webapps have a negligible learning curve and are probably easier to implement than Django apps?

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

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

发布评论

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

评论(3

一页 2024-12-04 04:41:22

在 Web 应用程序上使用 Django 有几个充分的理由:

  • 可移植性 - 使用通用框架可以更轻松地在 App Engine 和传统托管提供商之间移动现有应用程序。
  • 功能 - Django 是一个更强大的框架,具有更多功能。

但缺点是你是二等公民。大多数 Django 用户使用 SQL 后端,而大多数 App Engine 用户使用 webapp。框架和平台不一致的地方对于两者的开发人员来说将不再那么重要。

除非你有令人信服的理由使用 Django,否则我会坚持使用 webapp。

There are a few good reasons to use Django over webapp:

  • Portability - Using a general purpose framework makes it easier to move an existing app between App Engine and a traditional hosting provider.
  • Features - Django is a more robust framework with more bells and whistles.

The drawback, though, is that you're a second class citizen. Most Django users are working with a SQL backend, and most App Engine users use webapp. Places where the framework and the platform don't align are going to be less important to the developers of both.

Unless you have a compelling reason to use Django, I would stick with webapp.

奶气 2024-12-04 04:41:22

我即将完成我的第一个重要的 appengine 项目 - 在开发过程中,我从 django non-rel 切换到使用 gae 模型,但保留了 django 模板(和模板标签)。

对我来说,最大的问题是 non-rel 目前不支持交易。虽然您应该将交易的使用保持在最低限度以提高效率,但它们有时很有用(特别是在减少我的用户的帐户余额时!)。

当我切换时,我意识到我真的根本不了解数据存储。直接使用后我才看到non-rel隐藏的东西。这并不意味着一旦 non-rel 支持事务(我相信它们现在正在处理)我就不会切换回去,但我很高兴我确实直接使用了谷歌类一段时间。

所以我建议您至少尝试使用“原始”存储进行一些小实验,包括对象树和交易。然后,一旦您确定自己已经很好地理解了数据存储,请考虑使用non-rel(如果合适的话)(因为可移植性是不可否认的优势)。

请注意,我保留了 django 的模板和模板标签,以及 url 调度过程和常规配置。我确实查看了 gae 框架,但它似乎没有 django 提供的那么强大(例如,django 的命名 url 模式非常棒)。

tl;dr:我很高兴我离开了non-rel,但留在了django。这对我有用,但我会考虑将来回到非相关。

i am near completing my first significant appengine project - during development i switched from django non-rel to using gae models, but kept the django templates (and template tags).

for me, the deal-breaker was that non-rel currently does not support transactions. while you should keep the use of transactions to a minimum for efficiency, they are sometimes useful (particularly when decrementing the account balance of my users!).

when i switched i realised that i really had not understood the data store well at all. it was only after using it directly that i saw what non-rel had been hiding. this doesn't mean that once non-rel supports transactions (they are being worked on now, i believe) i wouldn't switch back, but i am glad that i did use the google classes directly for a while.

so i would suggest that you at least try a few small experiments with the "raw" store, including trees of objects and transactions. then once you're more sure that you've understood the data store well, consider using non-rel if it's suitable (because the portability is an undeniable advantage).

note that i kept django's templates and template tags, along with the url dispatch process and general config. i did look at the gae framework, but it didn't seem as powerful as what django gives (for example, django's named url patterns are pretty awesome).

tl;dr: i was glad i left non-rel, but stayed with django. that worked for me, but i would consider returning to non-rel in the future.

翻了热茶 2024-12-04 04:41:22

我认为说 GAE 网络应用程序“学习曲线可以忽略不计”是不正确的。虽然我发现它是一个优秀的 Web 应用程序平台,但它确实有许多方面与更传统的 CGI + SQL 平台有很大不同。

您可能能够像与任何其他提供商一样,编写一个可在 AppEngine 上运行的应用程序,但了解其中的复杂性、重要细节以及使 AppEngine 与众不同的差异和细节并非易事。

I think that it is incorrect to say that GAE webapps have 'a negligible learning curve.' While I have found it to be an excellent platform for web applications, it does have a number of aspects that are quite different from more traditional CGI + SQL platforms.

You'd probably be able to hack together an application that would work on AppEngine just like you could with any other provider, but learning the intricacies, the important details and differences and details that make AppEngine special, is not trivial.

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