Script that sets up a grok project directory, installs Zope 3 and grok and creates a template for a grok application.
Project description
grokproject provides an easy way to get started with a Grok web application. Simply install grokproject:
$ easy_install grokproject
If you have an old version of grokproject installed then you can upgrade doing:
$ easy_install -U grokproject
Afterwards you can run the grokproject script with the name of the project you’d like to create as an argument:
$ grokproject MammothHerd ... many lines of output here
This will not only create a project area for you to work in, it will also download and install Grok and Zope 3 (the application server Grok is built on).
After the project area has been created successfully, you will find an empty Python package in the src directory in which you can place the code for your web application.
To start the application server, execute:
$ cd MammothHerd $ bin/paster serve parts/etc/deploy.ini
There is also an Ajax enabled debugger (point your browser to http://localhost:8080/@@login.html when using this):
$ bin/paster serve parts/etc/debug.ini
Start/stop it in daemon mode:
$ bin/mammothherd-ctl start $ bin/mammothherd-ctl stop
Start the debugger:
$ bin/mammothherd-debug
For those who know paster: grokproject is just a wrapper around a paster template. So instead of running the grokproject command, you can also run:
$ paster create -t grok MammotHerd
To create a project with the previous zopectl layout run the grokproject script like:
$ grokproject --zopectl MammothHerd
or:
$ paster create -t grok MammothHerd zopectl=True
All configuration files used for running Grok can be found in the parts/etc/ directory of your project. These configuration files are generated automatically from the templates in etc/ on each buildout run. To modify the configuration files edit the approriate templates in etc/ and rerun buildout afterwards:
$ bin/buildout
This will rebuild the files in parts/etc/.
Changes
1.0.3 (2010-02-21)
Fix bug https://bugs.launchpad.net/grok/+bug/524000 Firsttime-user problem on win32: grokproject didn’t work if no .buildout/default.cfg existed and user had no pywin32 already installed.
Pin zope.app.container 3.8.1 and zope.app.folder 3.5.1 for project created with Grok 1.1a2 KGS (those packages were not pinned in the released versions.cfg).
For Python 2.5 and 2.6, use hashlib module instead of the deprecated sha module in Python 2.6.
Use bugfixed grokui.admin 0.4.1.
1.0.2 (2010-02-14)
Added license file.
1.0.1 (2010-01-24)
Fix bug https://bugs.launchpad.net/grok/+bug/487561 Granted zope.View and zope.app.dublincore.view permissions for all users (also authenticated ones) in site.zcml and ftesting.zcml templates.
Pinned down zc.zope3recipes for zopectl-driven installs. The more recent versions of zc.zope3recipes require zc.recipe.egg >= 1.2.0 which we currently do not support. As a result zctl-builds could fail due to unmet version constraints.
1.0 (2009-10-07)
The debug.ini file now by default configures the Unuathorized exception to not to be reraised. This will make sure Zope’s authentication mechanism keep working when using the z3c.evalexception middleware.
1.0b1 (2009-09-17)
The var/ directory is now used for var/filestorage, var/blobstorage and var/log instead of storing all that in the parts/ directory. This matches expectations of most users: parts/ can be rebuild, var/ must be backed up.
Added blob-storage in paster template’s zope.conf.in. Blob-storage is enabled by default.
Removed find-links from buildout.cfg.
Added two packages to the pinned versions in generated projects: z3c.recipe.dev = 0.5.3 zc.lockfile = 1.0.0
Using the just released z3c.recipe.eggbasket 0.4.3 in the generated projects.
Increased z3c.recipe.i18n version to use: 0.5.3 does not emit any warnings any more when being installed.
Assert that project names are valid python identifiers https://bugs.launchpad.net/bugs/223560 https://bugs.launchpad.net/bugs/373592
Generate the site.zcml containing the new default permission for grok. grok.View is now the default view instead of zope.Public.
1.0a4 (2009-04-17)
Fixed wrong site-definition path in generated zope.conf.
Fix bug https://bugs.launchpad.net/grok/+bug/358719 Backslashes in Windows paths are now quoted in Python expressions in configuration .ini files. Patches, testing and solutions from Ben Dadsetan and Roger Erens.
Add filter to include only eggs in generated versions.cfg that are not already provided by a downloaded grok KGS.
Reintroduce find-links to Zope package index in generated buildout.cfg to avoid problems with z3c.widget and other packages needing packages only hosted on Zope.
Removed grokui.admin from generated versions.cfg. It should be pinned down by Groks versions.cfg.
1.0a3 (2009-04-03)
Fix bug https://bugs.launchpad.net/grok/+bug/315223 The eggs-directory path that we put in ~/.buildout/default.cfg is now a shortened version on Windows (8.3 DOS style).
Fix bug https://bugs.launchpad.net/grok/+bug/160196 The initial password is now stored SHA1 encoded.
Make the zope.app.server.zpasswd utility available as a commandline tool in bin/.
Fix bug https://bugs.launchpad.net/grok/+bug/325299 The config files in paster-based grok projects are now generated by zc.buildout in the new location parts/etc/ and can be adjusted to local environments. Rerunning bin/buildout now rebuilds the configuration files in parts/etc/ from the templates that can be found in etc/.
To start paster you now have to do:
$ bin/paster serve parts/etc/deploy.ini
Fix bug https://bugs.launchpad.net/grok/+bug/315214 by supporting faster test runs. See README-shorttests.txt for details.
Pinned all package versions in the generated versions.cfg to the latest released ones. Especially pinned z3c.recipe.eggbasket to the most recent one, 0.4.1.
Integrated with grokcore.startup Removed startup.py from the paster template
Paster: you need to first access http://localhost:8080/@@login.html when running the debug.ini profile
Fix bug https://bugs.launchpad.net/grok/+bug/332173 add middleware to support access logging
1.0a2 (2009-01-12)
Add option --grokversion which installs the requested version of Grok with the created project. Examples:
grokproject --grokversion=0.14.1 Sample
or:
paster create -t grok Sample grokversion=0.14.1
Add option --version to show grokproject version and stay compatible with most command-line tools.
Fix bug https://bugs.launchpad.net/grok/+bug/315795 paster variant of grokproject now again accepts projectnames with uppercase chars.
1.0a1 (2009-01-08)
Fixed bug: using the --svn-repository option would fail with an OSError.
Add another template set for paster support
Add option –zopectl to select ‘zopectl’ templates
Make ‘paster’ the default template set
0.9 (2008-09-29)
Add grokui.admin as a dependency for projects created with grokproject.
Respect the verboseness requested by the user when running the final install.
Fix behaviour that produced double/triple output when buildout was invoked several times.
grokproject now uses z3c.recipe.i18n instead of lovely.recipe for generation of i18n-scripts.
At the end of the bootstrap.py of the generated project we now give the user a hint that he can run bin/buildout.
Explicitly run the install of the eggbasket recipe.
Fix ftesting.zcml to not include grok package : it precludes overrides of anything included by grok.
0.8 (2008-07-14)
Pinned zc.buildout and the used recipes in the generated versions.cfg.
Check for download errors when getting the release info files from grok.zope.org. That way we give a meaningful error message to the user.
Removed dependency on zc.buildout as we already use bootstrap.py-like code to install it on the fly if it is not there yet.
Removed code that was factored out into z3c.recipe.eggbasket and already gets invoked by grokproject by doing a “buildout bootstrap”.
Actually added the required eggbasket section to the generated buildout.cfg. Fixes https://bugs.launchpad.net/grok/+bug/242368
Catch download error when trying to get the big grok tarball.
Use a hardcoded bootstrap.py instead of referring to it via an external or downloading the current trunk revision upon each grokproject run (those options are potentially dangerous).
Also added a line at the end of bootstrap.py to install the eggbasket section.
Added a testbrowser test / functional test to the template.
Added a dependency on z3c.testsetup for created projects.
Factor out functions is_grok_installed and install_grok.
When grok is not installed yet, download a tar ball with all eggs needed by Grok and install those in the shared eggs directory.
If the user has a ~/.buildout/default.cfg nothing is added to the created buildout.cfg. If there is no default.cfg one is created with a line specifying the eggs-directory to ~/.buildout/eggs. If the user specified –eggs-dir/eggs_dir on the command line that will be added to buildout.cfg.
When there is no .buildout/default.cfg file, create it. Only put eggs-directory in the created buildout.cfg file when the user does not have it in default.cfg yet.
Do not ask for eggs dir when we have a default already.
Refactor grokproject/__init__.py by moving things out into main.py, templates.py and utils.py, like zopeproject does.
Add README.txt file to the created static/ dir. Biggest reason: otherwise ‘python setup.py sdist’ simply does not add that empty directory.
Added local download of the current fixed versions as versions.cfg.
Add handling for the eggs-directory option in buildout.cfg, taken from zopeproject.
Added a test for grokproject itself.
Copy the run_buildout function from zopeproject and put it in utils.py. Call that in the post hook of our paste template. In the grokproject command after calling paster just quit.
Do checks before asking questions. Define getters for some vars. Move no_buildout from the command to run_buildout in the template. Use version_info_url in the template instead of renaming it to extends.
Remove the –newer option for bin/grokproject. Use the ‘newest’ option from the template instead.
Move version_info_url to the template vars without making it a real question.
Rename the grokproject template to just grok. ME GROK LIKE SHORT NAMES.
Do not add eggs-directory to the buildout.cfg, as the absolute paths created make the resulting project unusable on other computers.
“bin/paster create -t grokproject” now works again.
Make sure bin/paster gets added so we can also test only our paster template instead of the command.
Fix https://bugs.launchpad.net/grok/+bug/223247: grokproject generates faulty ftesting.zcml. Replaced zope.app.securitypolicy.zopepolicy.ZopeSecurityPolicy with zope.securitypolicy.zopepolicy.ZopeSecurityPolicy in ftesting.zcml template (Depends on a Grok release > 0.11.1).
0.7 (2008-04-22)
Each of the interactive questions can now be set with an commandline option.
No longer ask for the name of the module that will contain the grok.Application subclass. It’s ‘app.py’ by default now, a rename is easy enough to do later on.
Fix https://bugs.launchpad.net/bugs/161947: The buildout.cfg template contained the [data] section twice.
Generate <includeDependencies package="." /> statement by default. If new dependencies are added to setup.py that need ZCML, the ZCML will be automatically loaded. (Depends on a new release of Grok with z3c.autoinclude)
0.6 (2007-10-10)
Added include package directive to ftesting.zcml_tmpl to enable functional testing of the generated application.
Updated template for site.zcml, no annoying warning at start.
Added buildout support for i18n (thanks to lovely.recipe.i18n).
The buildout.cfg that is created now has an extends directive that points to URL of the version.cfg of the current Grok release. This URL can be overridden with the –version-info-url commandline option.
See http://grok.zope.org/releaseinfo/readme.html for more information.
0.5.1 (2007-07-14)
Use the new ‘application’ recipe from zc.zope3recipes so that we can get rid of the dead chicken [zope3] section in buildout.cfg.
0.5 (2007-07-14)
The bin/instance script has been renamed to bin/zopectl for better recognizability.
grokproject is much quieter by default (by quieting down PasteScript, easy_install and zc.buildout). Use the -v option for verbose mode.
Fixed https://bugs.launchpad.net/grok/+bug/119805: A new project created with grokproject can’t be called ‘grok’ or ‘zope’.
By default, zc.buildout will now be told to place eggs in a user-specified shared eggs directory. Also, it will not look for newer versions of existing eggs by default.
0.4 (2007-07-12)
As grok now depends on Zope 3.4 eggs, use zc.zope3recipes application and instance recipes.
Don’t spawn processes to bootstrap and run the buildout. Instead, try to simply import zc.buildout. If that doesn’t work, call the setuptools API to install it and then simply import it.
Fixed https://bugs.launchpad.net/grok/+bug/113103: Default index template was missing closing html tag.
0.1 thru 0.3
Initial development versions, supporting Zope 3.3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.