名为“MyApp”的克隆应用程序飞机坠毁
我使用我的 Plone 实例文件夹的“bin/”目录中的“paster”命令来创建一个名为“MyApp”的 plone 应用程序(来自模板) - 该命令是:
(from instance's root folder):> ./bin/paster create -t plone_app
当要求提供名称时,我给了它“MyApp” ”。我将其复制到“src/”文件夹并将其注册到“buildout.cfg”文件中并运行 buildout。我有这个过程适用于其他具有不同名称的应用程序,但是似乎这个特定的应用程序总是使 Plone 崩溃。当我访问我的网站时,我得到的只是 Zope(并且无法访问 Plone)。有理由吗? “MyApp”是否是为导致崩溃的其他内容保留的命名空间?
我还应该注意到,名称“myapp”效果很好......
I used the "paster" command that comes in the "bin/" directory of my Plone's instance folder to create a plone app (from template) named "MyApp" - the command was:
(from instance's root folder):> ./bin/paster create -t plone_app
When asked for a name, I gave it "MyApp". I copied this to the "src/" folder and registered it within the "buildout.cfg" file and ran buildout. I have this process working for other apps with different names, however it seems that THIS particular app always crashes Plone. When I visit my site, all I get is Zope (and can't access Plone). Is there a reason why? Is "MyApp" a reserved namespace for something else that's causing a crash?
I should also note that a name "myapp" works just fine...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
值得注意的是(特别是与 Maurits 的回复相关),如果您使用“zopeskel”脚本而不是粘贴器,如下所示:
您将收到一条错误消息,告诉您需要一个带有两个点的名称。这是使用“zopeskel”脚本而不是 Paster 命令的主要原因之一。当你安装 zopeskel 时,你应该在 bin/paster 旁边有一个 bin/zopeskel。使用它,您将获得更好的错误消息和内联帮助。
It's worth noting (especially in relation to Maurits' response) that if you use the 'zopeskel' script instead of paster, like so:
You will get an error message telling you that you need a name with two dots. That's one of the primary reasons to use the 'zopeskel' script instead of the paster command. When you install zopeskel, you should have a bin/zopeskel right next to bin/paster. Use it, and you'll get better error messages and inline help.
对我有用:
使用构建:
显然这不是您期望的结果,paster 创建了一个名为“MyApp.plone.MyApp”的三重嵌套命名空间包:-)
进一步注意:此应用程序不会出现在 Plone 的附加组件中,除非您在 MyApp/plone/MyApp/configure.zcml 中添加 GenericSetup 配置文件,如下所示:
那么您应该看到:
最后,非命名空间包没有什么“错误”,它们只是约定(相对于平面命名空间包有优缺点,反之亦然)。请参阅:
了解“平面”命名空间的示例克隆包。
Works for me:
With buildout:
Obviously this is not the result you expect though, paster created a triple nested namespace package called "MyApp.plone.MyApp" :-)
Further note: this app will not appear in Add-ons in Plone, unless you add a GenericSetup profile in MyApp/plone/MyApp/configure.zcml like so:
Then you should see:
Finally, there is nothing "wrong" with non-namespace packages, they are just convention (with pros/cons over flat namespace packages, and vice versa). See:
for an example of a "flat" namespace Plone package.
当我尝试该命令时,它会像这样启动:
这意味着您应该选择一个带有两个点的名称,而不是 MyApp,例如 plone.app.mine。当您仅将 MyApp 作为项目名称时,它显然会创建一个包 MyApp.plone.MyApp。
是的,如果粘贴器(zopeskel)在这里给出错误就更好了。
实际上,当我在这里填写 MyApp 并在 Plone 4 站点中使用它时,它确实启动了。因此,粘贴您获得的确切回溯可能会有所帮助。但最好的可能是选择一个更好的名字。
Plone 本身对某些包使用嵌套命名空间(如 plone.app.locales)。对于你自己的项目,我会说这是矫枉过正。相反,请尝试使用“paster create -t plone”,它需要像 my.app 或 clientname.theme 这样的名称。
When I try that command it starts up like this:
This means that instead of MyApp you should choose a name with two dots, like plone.app.mine. When you just give MyApp as project name it apparently creates a package MyApp.plone.MyApp.
Yes, it would be nicer if paster (zopeskel) would give an error here.
Actually, when I fill in MyApp here and use that in a Plone 4 site it does actually start up. So it may help to paste the exact traceback you get. But best is probably to pick a better name.
Plone itself uses nested namespaces for some packages (like plone.app.locales). For your own projects I would say it is overkill. Instead try it with 'paster create -t plone' which expects a name like my.app or clientname.theme.