[Grok-dev] bypass UI adding application to grok AND multiple applications under /src howto?
Matt Rutherford
matrutherford at gmail.com
Mon Jan 16 13:51:57 UTC 2012
As he pointed out to me above, you need to add your new package 'mynewapp'
to the top-level setup.py's install_requires list, buildout again and then
it will appear as another option in the admin gui.
On 16 January 2012 13:33, Christian Schmidt <grok-list at creativenet.de>wrote:
> Hello Christian,
>
> first thank you for your reply. I followed your advice but like Matt i
> have still the same problem for trying to add a second application. Grok
> answers with the default app. Here is exactly what I did:
>
> grokproject example
> cd example/src
> ../bin/paster create -t basic_package mynewapp
>
> This create a new package base stucture unter
> example/src/mynewapp/mynewapp/
>
> __init__py.
>
> I added there
>
> app.py
> app_templates/
> static
> configure.zcml
>
> src/mynewapp/mynewapp/app.py:
>
> import grok
>
> #from example import resource
>
> class Mynewapp(grok.Application, grok.Container):
> pass
>
> class Index(grok.View):
> def render(self):
> <---->return "this is mynewapp"
>
> src/mynewapp/mynewapp/**configure.zcml:
>
>
> <configure xmlns="http://namespaces.zope.**org/zope<http://namespaces.zope.org/zope>
> "
> xmlns:grok="http://namespaces.**zope.org/grok<http://namespaces.zope.org/grok>
> ">
> <include package="grok" />
> <includeDependencies package="." />
>
> <grok:grok package="." />
> </configure>
>
> finally i changed the example/buildout.cfg:
>
> develop = . src/mynewapp
>
> [app]
> eggs =
> added -> mynewapp
>
> AND
>
> site.zcml =<include package="mynewapp"/>
>
> then ran bin/buildout
>
> returned:
>
> Develop: '/usr/home/chris_dev/example/.**'
> Develop: '/usr/home/chris_dev/example/**src/mynewapp'
>
> started the application and added mynewapp under UI:
> -> mynewapp (example.app.Example)
>
> http://127.0.0.1:8080/**mynewapp/index<http://127.0.0.1:8080/mynewapp/index>returned the default application.
>
> -> example/app_templates/index.pt (index.pt)
>
> If i change src/mynewapp/mynewapp/app.py: to -> Index1(grok.View):
> the page was not found.
>
> I would be thankful, if you have further ideas or solutions.
>
> Kind regard
>
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> https://mail.zope.org/mailman/listinfo/grok-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120116/14b69341/attachment.html>
More information about the Grok-dev
mailing list