0

I don't know why this is happening. I'm getting to grips with the Grok framework. While following the tutorial I encountered this error. When using TAL:attributes to link to a CSS style sheet, the index page loads with a system error message. The index file is called index.cpt If I change it to index.pt it loads correctly. Can anyone tell me why this is happening? Is the cpt file type restrictive or is it my code?


index.cpt:

<html>
<head>
<link rel="stylesheet" type="text/css" 
    tal:attributes="href static/style.css" />
</head>
<body>
    <p>Hello world!</p>
</body>
</html>

style.css:

body {
  background-color: #FF0000;
}

app.py:

import grok

from sample import resource

class Sample(grok.Application, grok.Container):
    pass

class Index(grok.View):
    pass

class Bye(grok.View):
    pass
soimon
  • 2,400
  • 1
  • 15
  • 16
adohertyd
  • 2,689
  • 19
  • 58
  • 78
  • could you provide more information about this error? what is error message? – Dmitry Zagorulkin May 18 '12 at 06:31
  • @HDDimon the error message is just simply "System error while loading page". It's related to the syntax of the code, specifically the tal:attributes part. I've added an answer to my question which explains more. – adohertyd May 18 '12 at 15:04

1 Answers1

2

It appears that the newest version of Grok uses the 'Chameleon' language(.cpt files) but the tutorial is still based on the Zope language(.pt files). There are some nuances between them so that is why I was getting the system error.

It's just a language syntax problem. I'm just renaming the files as .pt files instead of .cpt and working with Zope.

adohertyd
  • 2,689
  • 19
  • 58
  • 78