It is customary for any tutorial to contain an obligatory section about how to install the products being documented. Books about tech products likewise follow the same recipe. Rather than duplicate perfectly good material found elsewhere, we shall instead highlight here some of the things which are less obvious to newcomers.
Rather excellent details on how to go about installing Grok may be found on the getting started page on the main Grok web site.
_________________________________________________________________________________________
It all boils down to:
$ easy_install grokproject
$ grokproject mygrok
Note: at this time, grokproject is broken due to some changes to setuptools. It is still possible to use grokproject, by installing the latest zc.buildout package globally, and then manually running buildout after the automatic run fails. See below.
grokproject currently fails with the error:
"Couldn't find index page for zc.buildout (maybe misspelled?)"At this point, type:
$ cd <the name of the folder grokproject just created, eg "mygrok">
$ pip install zc.buildout
$ buildoutThis will complete the installation process.
________________________________________________________________________________
This will build a directory structure containing a working web server framework and a sample application in mygrok/src/mygrok/app.py
.
Assuming you used mygrok as the name of your grok project, some of the details are not necessarily intuitive to a first time user. The following comments and hints should prevent quite a bit of frustration for newcomers;
bin/paster serve --reload parts/etc/deploy.ini
will start up a server on port 8080 in production modebin/paster serve --reload parts/etc/debug.ini
will start up a server on port 8080 in development modegrok.Application
.zope.app.schema
" in your setup.py immediately when starting out. There is an outstanding problem whereby global utilities (grok.GlobalUtility
) don't register themselves unless this is done.entry_points={
'fanstatic.libraries': [
'mygrok = mygrok.resource:library',
...
]
}
include-site-packages = false
setting which may be set true if you want your local Grok instance to access site-wide packages.~/mygrok/bin/python_console
. This ensures that all of the buildout eggs are available to your IDE so that syntax highlighting and introspection works properly.