views:

36

answers:

1
<?python class += 1 ?>

One really simple line of code which definitely should work, but still it gives me this error:

TemplateSyntaxError: invalid syntax (file.html, line 22)

I shorted the filepath for readability, but that's the exact error. I'm definitely sure it should work, as I've used

<?python
    i += 1
?>

In another file, and it worked just fine there. Almost exact same structure; a table and a py:for loop. Tried everything, but can't get it to work! Any help?

+1  A: 

class is a Python keyword. You can't name a variable that.

Max Shawabkeh
Good point, thanks for that anyway. Oh crap; AttributeError: 'NoneType' object has no attribute 'strip'
TotempaaltJ