i avait Pylônes de configuration v0.9.7, et a créé un projet à l'aide genshi. J'ai essayé de coder un cas de test facile, mais cela ne fonctionne pas.Pylônes « nom global « c » est pas défini »
code: member.py
coding: utf-8
import logging import foo.model
from foo.lib.base import *
log = logging.getLogger(__name__)
class MemberController(BaseController):
def index(self):
c.title="title"
c.mes="message"
return render('test.html')
Code: test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:py="http://genshi.edgewall.org/"
lang="ja">
<head>
<title>${c.title}</title>
</head>
<body>
<p>${c.mes}</p>
</body>
</html>
et un message d'erreur (le journal)
Error - <type 'exceptions.NameError'>: global name 'c' is not defined
S'il vous plaît me aider à trouver l'erreur.
Giving est une lumière pour l'indice?. J'ai votre livre (python CookBook)! Je suis très honoré. Ci-après, il essaie à nouveau. – Schaft
Ahhh! ça a marché! merci Alex! Je comprends que "C était tmpl_context". Je souhaite sincèrement exprimer notre gratitude. – Schaft