简体   繁体   English

Google App Engine 中是否有等效的 Django 应用程序模式?

[英]Is there a Django apps pattern equivalent in Google App Engine?

Django has a very handy pattern known as "apps". Django 有一个非常方便的模式,称为“应用程序”。 Essentially, a self-contained plug-in that requires a minimal amount of wiring, configuring, and glue code to integrate into an existing project.本质上,这是一个独立的插件,需要最少的接线、配置和粘合代码即可集成到现有项目中。 Examples are tagging, comments, contact-form, etc. They let you build up large projects by gathering together a collection of useful apps, rather than writing everything from scratch.示例包括标记、评论、联系表格等。它们让您可以通过收集有用的应用程序集合来构建大型项目,而不是从头开始编写所有内容。 The apps you do end up writing can be made portable so you can recycle them in other projects.最终编写的应用程序可以移植,以便您可以在其他项目中回收它们。

Does this pattern exist in Google App Engine? Google App Engine 中是否存在这种模式? Is there any way to create self-contained apps that can be easily be dropped into an App Engine project?有什么方法可以创建可以轻松放入 App Engine 项目的自包含应用程序? Right off the bat, the YAML url approach looks like it could require a significant re-imagining to the way its done in Django.马上,YAML url 方法看起来可能需要对其在 Django 中的完成方式进行重大重新想象。

Note: I know I can run Django on App Engine, but that's not what I'm interested in doing this time around.注意:我知道我可以在 App Engine 上运行 Django,但这不是我这次感兴趣的。

The Django implementation of apps is closely tied to Django operation as a framework - I mean plugging application using Django url mapping features (for mapping urls to view functions) and Django application component discovery (for discovering models and admin configuration). The Django implementation of apps is closely tied to Django operation as a framework - I mean plugging application using Django url mapping features (for mapping urls to view functions) and Django application component discovery (for discovering models and admin configuration). There is no such mechanisms in WebApp (I guess you think of WebApp framework when you refer to AppEngine, which is rather platform ) itself - you have to write them by yourself then persuade people to write such applications in a way that will work with your url plugger and component discovery after plugging app to the rest of site code. WebApp 本身没有这样的机制(我猜当你提到 AppEngine 时你会想到 WebApp框架,它是一个平台)本身——你必须自己编写它们,然后说服人们以适合你的方式编写这样的应用程序将应用程序插入站点代码的 rest 后, url 插件组件发现

There are generic pluggable modules , ready to use with AppEngine, like sharded counters or GAE utilities library, but they do not provide such level of functionality like Django apps (django-registration for example).有通用的可插入模块,可以与 AppEngine 一起使用,例如分片计数器或 GAE 实用程序库,但它们不提供像 Django 应用程序(例如 django-registration)这样的功能级别。 I thing this comes from much greater freedom of design (basically, on GAE you can model your app after Django layout or after any other you might think of) and lack of widely used conventions.我认为这来自更大的设计自由度(基本上,在 GAE 上,您可以在 Django 布局之后或您可能想到的任何其他布局之后 model 您的应用程序)并且缺乏广泛使用的约定。

I'd like to add that you can run Django apps inside App Engine.我想补充一点,您可以在 App Engine 中运行 Django 应用程序。 I've been doing this successfully for the last few months.在过去的几个月里,我一直在成功地做到这一点。 Basically, you can make use of theApp Engine Helper project or App Engine Patcher .基本上,您可以使用App Engine Helper项目或App Engine Patcher The App Engine Helper is maintained, in part, by google employees, so that's the one I use, thought the App Engine Patcher's maintainer is always feverishly promoting and updating his project (perhaps a little too much:) App Engine Helper 部分由谷歌员工维护,所以这是我使用的那个,我认为 App Engine Patcher 的维护者总是在狂热地推广和更新他的项目(也许有点太多了:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM