[Grok-dev] bypass UI adding application to grok AND multiple applications under /src howto?
Christian Schmidt
grok-list at creativenet.de
Mon Jan 16 13:33:21 UTC 2012
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"
xmlns: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 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grok-list.vcf
Type: text/x-vcard
Size: 361 bytes
Desc: not available
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120116/85ebac7b/attachment.vcf>
More information about the Grok-dev
mailing list