[Grok-dev] bypass UI adding application to grok AND multiple applications under /src howto?
goschtl at googlemail.com
Sat Jan 14 08:17:41 UTC 2012
Christian Schmidt schrieb:
> Hi there,
> We are testing if grok is the solution for us to develop our new user
> interface. We are discussing and testing the grok framework consulting
> the grok tutorial and the book of Carlos de la Guardia - Grok 1.0 Web
> One of our programmers has the opinion that it would be hard to place it
> under version control - referring
> Problem is - he is thinking - the data.fs ZODB. But, we don't save
> userdata there - all data will be stored with sqlalchemy under postgres.
> So there would be clean rebuild for any new installation if data.fs does
> not exists. But, is there a way to bypass adding the application name
> into the Grok UI? - I have googled that, but found nothing.
> The idea is, that we download our application from svn or git, make a
> python bootstrap.py and bin/buildout and all works out of the box - on
> every developers local box or production server. - no application name
> UI adding.
You can do this easily with zope.generations. There is an howto
for using it. You can find it here.
I guess you have to add a missing zcml statement in configure.zcml
<include package="zope.generations" file="subscriptions.zcml"/>
> Our further goal is to manage different things. We need something like
> http://EXAMPLE.com/customers/show | edit | etc.
> Do we need to create multiple applications under src/? - what would be
> the right way?
> My Idea was:
> [localpy] %grokproject myproject
> [localpy] %cd myproject/
> [localpy] %python bootstrap.py
> [localpy] %bin/buildout
> creates myproject with the default structure.
> [localpy] %ls src/
> [localpy] %bin/paster serve parts/etc/debug.ini
> Starting the Server the UI shows no application:
> "Currently no working applications are installed."
> To enable the default application "myproject" I have to add the
> application to grok. The only way I know is to add this unter der Server
You can use zope.generations as mentioned on top of the response.
> If I want now create an other application under src. How would I do
> that? I want to have ie:
> My Idea was to copy all files from myproject to mailadmin and change the
> template. Is there a paster - template available for that job? (creating
> a grok sub-application under src)
What i do is to generate a basic python package via paster. I copy this
new package in src directory of my generated grokproject. This would be
in your case something like:
myproject/src/mailadmin/... <-- This is my generated paster package
Ok now you have to change a line in your buildout.cfg file.
develop = .
develop = . src/mailadmin
rerun bin/buildout. And you can start to add classes to your new
> Adding this mailadmin application to grok whit the UI does not the job,
> because http//127.0.0.1:8080/mailadmin shows the template of
> myproject/app_templates/index.pt not mailadmin/app_templates/index.pt.
> How to add mailadmin to the grok application, enable the application so
> my request for http//127.0.0.1:8080/mailadmin shows
> mailadmin/app_templates/index.pt. Do I have to add it to any configfile
> as well?
> I found that this should be possible, but not how in detail:
> I hope that i have written all detailed enough an think that many other
> have the same problems in understanding grok and I would be glad, if
> someone helps me to take the first cliffs.
BTW you can join the grok-irc channel. Sometimes you get really fast
help from there.
If you have further questions, please let me know.
> Kind regards
More information about the Grok-dev