Python/GAE 社交网络/cms?
经过大量研究,我列出了我认为可能是组合基于 Python 的社交网络/cms 的最佳方式的列表,但对其中一些组件如何组合在一起有一些疑问。
在我询问特定组件之前,这里是要构建的站点的一些关键功能:
- 现代的几乎类似桌面的 GUI
- 未来能够托管高级 html5 子应用程序(例如http://www.lucidchart.com)
- 功能和用户负载的高可扩展性
- 用户能够对每个项目/组进行密码保护和权限管理内容基于
- 典型的社交网络功能,
- 能够在未来构建缩小的移动版本
以下是我正在考虑使用的工具列表:
Google App Engine
Python 姜戈 松属 睡衣 wxPython
以及问题:
Google App Engine——这是一次切入正题的尝试,因为谜题的许多部分似乎已经就位。 问题:我的选择是否限制了我的选择?示例:数据存储不是关系型的?我应该等待吗 商业版本下的 SQL 支持?
Python——我一开始考虑过“drupal”,但最终决定依赖于可能或 明天可能不存在+其模板系统的局限性是一个禁忌。学习它的 API 在其他地方也是没有用的 而 Python 看起来就像一把语言中的瑞士军刀——几乎适用于任何事物。 问题:GAE 需要 v.2.5.2,但 python.org 推荐 2.5.5。我该安装哪个?
Django——v.0.96 内置于 GAE 中。看来你可以升级了。 问题: 有什么理由不升级到最新版本?如何解决缺乏 HTML5 支持的问题?
Pinax (http://pinaxproject.com) 骑在 Django 之上,似乎提供了大部分社交功能网络功能 任何人都会想要的。 问题:不使用它的原因是什么?替代方案?
Pyjamas 和 wxPython——这是有点令人困惑的部分。这些背后的基本思想是能力 构建一个 GUI。在 GAE/Python 路线之前,我考虑过 Silverlight 和 Flash,但有几个可用版本 HTML5 应用程序让我相信,足够多的应用程序已经在最新一批浏览器上运行,因此选择了 HTML5/Javascript 路线代替。 问题:如何扩展/补充 Python/Django 来构建类似应用程序的 HTML5 界面?睡衣和wxPython都是吗 该怎么走?或者我应该完全改变我的想法?
对其中一些/任何问题的回答将会有很大帮助。如果这些没有多大意义,请原谅我的无知。 我最后一次涉足 Web 编程是大约 5-6 年前的一个规模相当大的 LAMP 网站。在桌面方面, 我的编程经验归结为非常高级的脚本语言,我不断学习这些语言来完成非常具体的任务 任务:)
After much research, I've come up with a list of what I think might be the best way of putting together a Python based social network/cms, but have some questions about how some of these components fit together.
Before I ask about the particular components, here are some of the key features of the site to be built:
- a modern almost desktop-like gui
- future ability to host an advanced html5 sub-application (ex.http://www.lucidchart.com)
- high scalability both for functionality and user load
- user ability to password protect and permission manage content on per item/group basis
- typical social network features
- ability to build a scaled down mobile version in the future
Here's the list of tools I'm considering using:
Google App Engine
Python
Django
Pinax
Pyjamas
wxPython
And the questions:
Google App Engine -- this is an attempt to cut to the chase as many pieces of the puzzle seem to be in place.
Question: Am I limiting my options with this choice? Example: datastore not being relational? Should I wait
for SQL support under the Business version?Python -- I considered 'drupal' at first, but in the end decided that being dependent on modules that may or
may not exist tomorrow + limitations of its templating system are a no-no. Learning its API, too, would be useless elsewhere
whereas Python seems like a swiss army knife of languages -- good for almost anything.
Question: v.2.5.2 is required by GAE, but python.org recommends 2.5.5. Which do I install?Django -- v.0.96 is built into GAE. You seem to be able to upgrade it.
Questions: Any reason not to upgrade to the latest version? Ways to get around the lack of HTML5 support?Pinax (http://pinaxproject.com) Rides on top of Django and appears to provide most of the social network functionality
anyone would want.
Question: Reasons NOT to use it? Alternatives?Pyjamas and wxPython -- this is the part that gets a little confusing. The basic idea behind these is the ability
to build a GUI. I've considered Silverlight and Flash, before the GAE/Python route, but a few working versions of
HTML5 apps convinced me that enough of it ALREADY runs on the latest batch of browsers to chose the HTML5/Javascript
route instead.
Question: How do I extend/supplement Python/Django to build an app-like HTML5 interface? Are Pyjamas and wxPython
the way to go? Or should I change my thinking completely?
Answers to some/any of these questions would be of great help. Please excuse my ignorance if any of this doesn't make much sense.
My last venture into web programming was a decent sized LAMP website some 5-6 years ago. On the desktop side of things,
my programming experience boils down to very high level scripting languages that I keep on learning to accomplish very specific
tasks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为已将 Django 站点部署到 GAE 的人,我可以告诉您,您不会达到理想的解决方案。 GAE 上的 Django 错过了 Django 的一些最佳方面,因为 ORM 无法正常工作。最好的折衷方案可能是使用 Django-nonrel 重新添加功能。
这引入了但这是它自己的问题:由于 Django 应用程序使用大量文件和内存,您的代码将在应用程序空闲后很快从内存中卸载。这意味着,当 GAE 解压缩压缩模块时,从内存中卸载网站代码后,访问者在首次页面查看时经常会遇到大约 6 秒的延迟。一旦您的网站繁忙,这不会成为问题,但当您的网站还很年轻且未知时,它会导致性能问题的出现。 :-(
其次,我也曾在一家构建自定义 CMS 的公司工作过,可以告诉您前 80% 非常简单,尤其是使用现代框架。但是,其余部分可能相当具有挑战性。例如,用户角色和自定义内容类型是两个具有挑战性的方面,因此强烈考虑站在巨人的背后,找到一个几乎完全满足您的需求的 CMS 或 CMS 框架,然后扩展它来完成您需要的额外功能
。要点:
是的,您限制了您的选择,但这可能是好的,因此大多数开发人员都更喜欢关系模型而不是 nosql 模型,因此更多的开源软件是在构建时考虑到的。闭源平台也阻碍了开源开发者。 a> 是一个可能非常适合您并针对 App Engine 进行了优化的 CMS 框架。另请参阅 web2py,它支持GAE。
我发现自己使用 Python 的效率非常高。我曾经写过很多PHP,现在我发现它很难看。也就是说,请考虑一下您必须编写的代码的总行数。如果您可以让 Drupal 使用高质量的预制模块,您可能会发现自己只需要 1/10 的代码。顺便说一句,Drupal 的技巧是主要只使用高质量的模块。查看历史记录,确保不要使用开发版本。尝试通过 IRC 联系作者。我并不是说您应该使用 Drupal,但可以使用它建立一个可靠的网站(例如,whitehouse.gov)
您遇到了经典的 GAE/Django 问题。如果您使用 0.96,您将获得出色的性能,但您会错过许多 1.0+ 的出色功能,并且您无法获得 ORM 及其所有优势。如果您使用较新版本的 Django,您会遇到上面提到的性能/内存问题。
我即将为我的公司调查 pinax。我用光标粗略地浏览了一下。我不知道它是否对非关系模型后端有很好的支持。您可能需要查看 django-nonrel。但要知道,您将在这里投资相对未经尝试的解决方案。一小部分 Django 用户使用 Pinax,甚至更小的比例(如果有的话)在非关系后端上使用它。因此,您将处于上面第 2 点提到的高度实验场景中。
我无法提供个人经验。我调查过睡衣几次。不过我喜欢编写 HTML CSS 和 JS。我喜欢控制。我喜欢渐进式增强,并且知道如果用户不具备全部功能,他们会看到什么。另外,我认为任何没有明确解决移动客户端问题的新应用程序都是在搬起石头砸自己的脚。多达 15% 的互联网用户仅通过智能手机使用互联网。他们穿着睡衣会得到什么样的体验?
您没有提到这一点,但我在选择平台时考虑的一件事是供应商锁定和可移植性。如果您为 GAE 开发解决方案并发现无法执行您想要的操作,您是否能够将其移植到其他地方的另一个解决方案?需要做多少工作?如果您为 GAE 编写了大量代码或对其架构做出了承诺,那么您就会受困于它或重写以移动。使用 Django 或 Web2py 可以帮助缓解这种情况。
也就是说,Python GAE 的一大好处是您可以提高工作效率,立即看到结果,在您的网站很小的情况下免费获得托管,并获得出色的可扩展性。这些都不是小事。那里有很大的价值。
As someone who has deployed a Django site to GAE, I can tell you that you are not going to reach the ideal solution. Django on GAE misses some of the best aspects of Django because the ORM doesn't work right. The best compromise may be to use Django-nonrel to add the features back in.
This introduces it's own problems though: because of the large number of files and memory used by a Django app you're code will be unloaded from memory quickly after the app becomes idle. That means that visitors will frequently hit an approximately 6 second delay on the first page view after the site's code has been unloaded from memory while GAE uncompresses the zipped modules. Once your site is busy this won't be a problem, but while your site is still young and unknown it will cause the appearance of performance problems. :-(
Second, I've also worked for a company that built a custom CMS and can tell you that the first 80% is pretty easy, especially with modern frameworks. However, the rest can be quite challenging. For example, user roles and custom content types are two challenging aspects. Therefore strongly consider standing on the backs of giants and finding a CMS or CMS framework that almost perfectly meets your needs and then extend it to do that extra bit you need.
So, that said, answering your points:
Yes, you're limiting your options but that may be OK. Most developers are more comfortable with the relational model than the nosql model. Therefore more open source software is built with it in mind. Also, GAE is a closed source platform which is also a deterrent to open source developers. App Engine Oil is a CMS framework that may suit you well and is optimized for App Engine. Also look at web2py which has support for GAE.
I've found myself to be extremely productive with Python. I used to write a lot of PHP now I find it ugly. That said, think about the total line count of code you'll have to write. If you can make Drupal work with high quality pre-made modules you may find yourself only needing 1/10th of the code. By the way, the trick with Drupal is to mainly use only high quality modules. Look at the history, make sure not to use development versions. Try to contact the authors on IRC. I'm not saying you should use Drupal but it is possible to have a reliable site with it (for example, whitehouse.gov)
You're in the classic GAE/Django problem. If you use 0.96 you get great performance but you miss a lot of the great 1.0+ features and you don't get the ORM and all of it's benefits. If you use a newer version of Django you get the performance/memory problems mentioned above.
I'm about to investigate pinax for my company. I've done a very cursor glance at it. I don't know if it has good support for non relational model backends. You'll probably need to look at django-nonrel. However know that you're going to be investing in relatively untried solutions here. A small percentage of Django users use Pinax and an even smaller percentage, if any, use it on a nonrelational backend. Therefore you're going to be in the highly experimental scenario you mentioned in point 2 above.
I can't offer personal experience on it. I've investigated pyjamas a few times. However I like writing HTML CSS and JS. I like to have control. I like progressive enhancement and knowing what users will see if they don't have the full capabilities. Also, I think any new app that doesn't explicitly address mobile clients is implicitly shooting themself in the foot. As many as 15% of Internet users only use the Internet via their smart phone. What kind of experience will they get with pyjamas?
You didn't mention this, but one thing I consider when choosing a platform is vendor lockin and portability. If you develop your solution for GAE and find that you're not able to do what you want, will you be able to port it to another solution elsewhere? How much work will it take? If you code heavily for GAE or make commitments to its architecture, you're stuck with it or with rewriting to move. Using Django or Web2py can help mitigate this.
That said, the big benefit of Python GAE is that you get to be very productive, see your results instantly, get hosting for free while your site is small and get excellent scalability. These are not small things. There is great value there.