如何为 Google App Engine 设计可扩展的 CMS?

发布于 2024-08-15 02:37:00 字数 208 浏览 3 评论 0原文

我非常喜欢 CMS 的可扩展性。您可以上传一些代码(通常是 PHP),从 CMS 管理面板对其进行授权,然后它就会运行。

我想知道在 Google App Engine 中是否可行。我还没有检查 Google App Engine 的现有 CMS 的可扩展性,但如果其中有任何支持插件,我想知道他们是如何做到的,以及它们是否只是 JS 插件,或者是否支持 Python/Java插件也。

I am a fan of the extensibility of the CMSes. You can upload some code (usually PHP), authorize it from the CMS admin panel and it's running.

I wonder if it is possible in Google App Engine. I haven't checked the extensibility of existing CMSes for Google App Engine, but if there is any of them that supports plugins I would like to know how they did it, and whether they are JS plugins only, or if they support Python/Java plugins too.

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

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

发布评论

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

评论(3

筑梦 2024-08-22 02:37:00

来自 Google 的 Nick Johnson 撰写了整个博客文章系列,介绍如何编写 应用程序引擎的博客系统。如果它不能满足您的要求,我相信您可以扩展它,但对于大多数人来说,博客系统对于 CMS 来说通常就足够了。

Nick Johnson from Google wrote an entire blog post series on how to write a blog system for app engine. If it doesn't do what you want, I am sure that you can extend it but normally a blogging system is sufficient for a CMS for most people.

成熟的代价 2024-08-22 02:37:00

我没有公开的示例(抱歉),但我可以确认可以为 App Engine 项目创建 Python 插件。几个月前我完成了一个项目,它做了类似的事情。问题的关键在于一行 python:

exec plugincode in someDict

上面的“plugincode”是一个包含一些要执行的 python 代码的字符串,someDict 是一个用于执行它的全局字典。这可以说比使用 eval() 更干净。在我们的例子中,全局字典包含插件代码用于与系统通信的对象的实例。我想不出这种(或类似)方法有什么主要限制。例如,plugincode 可以声明一个类,并将该类的实例注册为回调处理程序等。

在我们的例子中,我们将插件代码存储在数据存储中,并在适当的时间加载它(例如,当应用程序的实例启动时) )。

I don't have a public example to point to (sorry), but I can confirm that it is possible to create Python plugins for an App Engine project. I completed a project a few months ago that does something like this. The crux of the thing comes down to a single line of python:

exec plugincode in someDict

Above 'plugincode' is a string containing some python code to execute, and someDict is a dictionary of globals to execute it in. This is arguably cleaner than using eval(). In our case the globals dictionary contained an instance of an object that the plugincode used to communicate with the system. I can't think of any major limitations with this (or similar) approaches. e.g. plugincode could declare a class, and register an instance of that class as a callback handler etc etc.

In our case we stored the plugin code in the Data Store, and loaded it at appropriate times (e.g. when an instance of the app is started).

远昼 2024-08-22 02:37:00

实际上,我认为 App Engine 应用程序中支持插件没有概念上的问题。例如,在 Java 上,您可以从数据存储或内存缓存中将插件 jar 获取到内存(在应用程序初始化阶段),然后使用自定义类加载器根据需要加载插件类。实际上,您甚至可以从请求数据加载类,并在需要时动态评估它们(我们如何在 中执行此操作) AppWrench Java 控制台)。

问候,
帕维尔.

Actually I see no conceptual problem with supporting plugins in App Engine application. For example on Java you may fetch plugin jar to memory from data store or memcache (on application initialization phase), and then use custom class loader to load plugin classes as needed). Actually you even may load classes from request data and evaluate them on the fly if needed (how we do it in AppWrench Java console).

Regards,
Pavel.

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