TemplateSyntaxError: All content must be inside a block tag

已查看 312 次
跳至第一个未读帖子

Elman Torres

未读,
2021年9月17日 18:15:272021/9/17
收件人 oTree help & discussion
Hello Everyone,

I recently upgrade otree. I had apps without problems. But now when I try to run these apps show me the following error message 

"All content must be inside a block tag", token
otree.templating.errors.TemplateSyntaxError: All content must be inside a block tag (line 3, in "<body")


I don´t Know how to fix this problem. Can you help me, please.

Best,

Elman

Chris @ oTree

未读,
2021年9月17日 18:47:512021/9/17
收件人 oTree help & discussion
All content must be inside a block. For example:

BAD
{{ block title }} GOOD {{ endblock }}
{{ block content }}
GOOD
{{ endblock }}
BAD

That content you currently have outside of the block has no effect. So you should either put it inside a block, or delete it.
Old versions of oTree didn't warn about this, but the newest version raises an error to let you know.

Chris @ oTree

未读,
2021年9月17日 18:55:002021/9/17
收件人 oTree help & discussion
By the way, you don't need <body> in your template code. oTree automatically adds the <body> tag.

Elman Torres

未读,
2021年9月17日 19:02:182021/9/17
收件人 oTree help & discussion
Hello Chris,

Thank you.

Best,

Elman

dklin...@gmail.com

未读,
2021年9月23日 15:12:292021/9/23
收件人 oTree help & discussion
Hi,

On this point, inside what block would you put the internal css <style> </style> script? 



Chris Crabbe

未读,
2021年9月23日 15:35:562021/9/23
收件人 dklin...@gmail.com、oTree help & discussion
Hi -

I use {{ block styles }} for that.

Thanks,
--Chris

--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/7567a96b-7121-42bd-943c-d2847fe91bcan%40googlegroups.com.
回复全部
回复作者
转发
0 个新帖子