Monday, April 12, 2010

Update on grok web development tryout

After dancing around the pale moonlight with a newly slaughtered chicken in my birthday suit, offering fruits to the grok gods, finally today the gods were kind on me and helped me along to find this solution that works! The closest I got the example in the grok book to work is to install the grokproject and start a new project without errors, but when I try to start up the devel server, all sorts of strange manner of monsters jumped out at me.

Just have a look at this : What needs to be done is to edit the paster template and everything will work fine. I guess either this bug has not been looked into or is still an open bug.

Heh! I spoke too soon, I got to the main page of grok management but as soon as I try to do anything, I get this:

"TypeError: character mapping must return integer, None or unicode"

Hmmm ... google gods say this:

Not really a solution

Not much of a solution it seems, just that Python-2.6 is not supported. I am using grokproject, but how can I see what version of grok is grokproject using. As the mail says, errors like this is really really off putting and does not help with building confidence with the project!

Grok 1.0 Web Development


kedai said...

it's weird you have so much problem installing.

i've had good luck since grok 0.x. no voodoos involved :P

what i did:

- install python from source [**

- install easy_install and virtualenv

- create the virtualenv for my grok

- activate my grok virtualenv

- easyinstall grokproject

- start the default project, and i could get to the project's web and manage pages

- modify the projects and all's good.

good luck! [some of my grok experimentation

Michael Foord said...

Hah, a few minutes after reading this I got exactly the same error message using an old blog tool of mine with Python 2.6 ("TypeError: character mapping must return integer, None or unicode" exception from the hmac module). Thanks to your blog entry I knew that all I had to do was run it with Python 2.5 instead. :-)

lowkster said...

kedai: did you run it with python2.6 ? I think that is the key to all these problems.

kedai said...

as pointed out by maartijn, and stated in the grok official site, only python versions 2.4 and 2.5 are supported for now.

using unsupported/untested python version and painting a gloomy picture is a bit unfair.

casual browsers/evaluators may come to the wrong conclusion. those who tried it out may get the true picture but then notes from experienced pythonistas like your self may carry some weight and push these users out from trying grok.

if you could use the supported python version and document your experience, that'd be a boon to all.


Anonymous said...

Python 2.6 was released in October *2008*, over 18 months ago. Today's Python news is that there's a beta release for 2.7!

I think it's reasonable for someone to expect a web toolkit to either (a) support a non-cutting-edge version of the language, or at the very least (b) gracefully handle the problem, e.g. an error message saying "I see you're trying to use Python 2.6! You'll need to use 2.5 instead!"

lowkster said...

kedai: Funny I got a different impression as to what maartijin commented from an earlier post .. and I quote "As to Grok with Python 2.6, Grok 1.1 will support Python 2.6.". This lead me down the road to try out Grok 1.1. As to the picture being gloomy, it was not written intended to sound that way, just a blow to blow how I got the examples working.

I think a 'casual evaluator' would still think twice of trying out a framework which forces you to install an older version of Python to work correctly. I think that I would be doing the community service reporting bugs that I find testing out Grok on a _recent_ version of Python. As I said in my review, I like and still support Zope / Plone. Had I been any lesser of a fan I would have given up probably at page 10!

Thanks for the feedback :).

lowkster said...

johntrammell: My sentiments exactly! I like the way they have taken Zope, now if they would only use the latest version of Python, then every single thing would be dandy!

kedai said...

lowkster said...

kedai: Ah! Thank you for putting the money where it belongs! :) That works! That means that some of the examples in the book needs to be changed? Perhaps the paste script needs some work?

kedai said...

I think the book was written with grok 1.0 in mind? I haven't received my book yet ( 2 months!) so can't really say.

anyways, the only difference is when creating the grok project

grokproject --grokversion=1.1rc1

will get you the *version* you care.

else it'll get the stable release.

lowkster said...

kedai: It's hard to write a book about grok at this stage of development but I think the author should have covered this part too no?

kedai said...
This comment has been removed by the author.
kedai said...

guessed when carlos (the author) started, there was no 1.1 alpha or beta. and 1.0 only supports 2.4 and 2.5

and most linux distros at that time has python 2.5 as the default (centos, redhat does, at least).

and these distros has like 7 years cycle so, py 2.5 *is* the default python

when i evaluate i usually heed the projects advice, so in this case, having py 2.4 or 2.5 is a must.

and i think grok should have this in its site:

grokproject --grokversion=1.1rc1 sample

so that those who wants to try grok with py 2.6 will not face what you faced.

but that's just me.