Skip to main content
 首页 » 编程设计

python之使用应用引擎上传网站后出错

2025年05月04日15soundcode

在我使用 App Engine 上传我的网站后,我收到以下错误消息:

Traceback (most recent call last): 
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 710, in __call__ 
    handler.get(*groups) 
  File "/base/data/home/apps/s~americocunhajr/1.363201743143209914/main.py", line 16, in get 
    self.response.out.write (template.render (path, {})) 
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/template.py", line 91, in render 
    t = _load_user_django(template_path, debug) 
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/template.py", line 113, in _load_user_django 
    template = django.template.loader.get_template(file_name) 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/loader.py", line 80, in get_template 
    template = get_template_from_string(source, origin, template_name) 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/loader.py", line 88, in get_template_from_string 
    return Template(source, origin, name) 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/__init__.py", line 158, in __init__ 
    self.nodelist = compile_string(template_string, origin) 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/__init__.py", line 174, in compile_string 
    return parser.parse() 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/__init__.py", line 254, in parse 
    filter_expression = self.compile_filter(token.contents) 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/__init__.py", line 338, in compile_filter 
    return FilterExpression(token, self) 
  File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/template/__init__.py", line 558, in __init__ 
    raise TemplateSyntaxError, "Could not parse the remainder: %s" % token[upto:] 
TemplateSyntaxError: Could not parse the remainder: {*/\nbody {\n   background: [[ColorPalette::Background]];\n color: [[ColorPalette::Foreground]];\n}\n\na{\n color: [[ColorPalette::PrimaryMid]];\n}\n\na:hover{\n   background: [[ColorPalette::PrimaryMid]];\n color: [[ColorPalette::Background]];\n}\n\na img{\n border: 0;\n}\n\nh1,h2,h3,h4,h5 {\n color: [[ColorPalette::SecondaryDark]];\n   background: [[ColorPalette::PrimaryPale]];\n}\n\n.button {\n    color: [[ColorPalette::PrimaryDark]];\n border: 1px solid [[ColorPalette::Background]];\n}\n\n.button:hover {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::SecondaryLight]];\n border-color: [[ColorPalette::SecondaryMid]];\n}\n\n.button:active {\n  color: [[ColorPalette::Background]];\n  background: [[ColorPalette::SecondaryMid]];\n   border: 1px solid [[ColorPalette::SecondaryDark]];\n}\n\n.header {\n    background: [[ColorPalette::PrimaryMid]];\n}\n\n.headerShadow {\n   color: [[ColorPalette::Foreground]];\n}\n\n.headerShadow a {\n  font-weight: normal;\n  color: [[ColorPalette::Foreground]];\n}\n\n.headerForeground {\n    color: [[ColorPalette::Background]];\n}\n\n.headerForeground a {\n  font-weight: normal;\n  color: [[ColorPalette::PrimaryPale]];\n}\n\n.tabSelected{\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::TertiaryPale]];\n   border-left: 1px solid [[ColorPalette::TertiaryLight]];\n   border-top: 1px solid [[ColorPalette::TertiaryLight]];\n    border-right: 1px solid [[ColorPalette::TertiaryLight]];\n}\n\n.tabUnselected {\n   color: [[ColorPalette::Background]];\n  background: [[ColorPalette::TertiaryMid]];\n}\n\n.tabContents {\n   color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::TertiaryPale]];\n   border: 1px solid [[ColorPalette::TertiaryLight]];\n}\n\n.tabContents .button {\n    border: 0;}\n\n#sidebar {\n}\n\n#sidebarOptions input {\n  border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel {\n  background: [[ColorPalette::PrimaryPale]];\n}\n\n#sidebarOptions .sliderPanel a {\n border: none;\n color: [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel a:hover {\n color: [[ColorPalette::Background]];\n  background: [[ColorPalette::PrimaryMid]];\n}\n\n#sidebarOptions .sliderPanel a:active {\n   color: [[ColorPalette::PrimaryMid]];\n  background: [[ColorPalette::Background]];\n}\n\n.wizard {\n background: [[ColorPalette::SecondaryLight]];\n border-top: 1px solid [[ColorPalette::SecondaryMid]];\n border-left: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.wizard h1 {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.wizard h2 {\n    color: [[ColorPalette::Foreground]];\n}\n\n.wizardStep {\n  background: [[ColorPalette::Background]];\n border-top: 1px solid [[ColorPalette::SecondaryMid]];\n border-bottom: 1px solid [[ColorPalette::SecondaryMid]];\n  border-left: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.wizard .button {\n    color: [[ColorPalette::Background]];\n  background: [[ColorPalette::PrimaryMid]];\n border-top: 1px solid [[ColorPalette::PrimaryLight]];\n border-right: 1px solid [[ColorPalette::PrimaryDark]];\n    border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n   border-left: 1px solid [[ColorPalette::PrimaryLight]];\n}\n\n.wizard .button:hover {\n  color: [[ColorPalette::PrimaryLight]];\n    background: [[ColorPalette::PrimaryDark]];\n    border-color: [[ColorPalette::PrimaryLight]];\n}\n\n.wizard .button:active {\n  color: [[ColorPalette::Background]];\n  background: [[ColorPalette::PrimaryMid]];\n border-top: 1px solid [[ColorPalette::PrimaryLight]];\n border-right: 1px solid [[ColorPalette::PrimaryDark]];\n    border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n   border-left: 1px solid [[ColorPalette::PrimaryLight]];\n}\n\n#messageArea {\n   border: 1px solid [[ColorPalette::SecondaryDark]];\n    background: [[ColorPalette::SecondaryMid]];\n   color: [[ColorPalette::PrimaryDark]];\n}\n\n#messageArea .button {\n    padding: 0.2em 0.2em 0.2em 0.2em;\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::Background]];\n}\n\n.popup {\n  background: [[ColorPalette::PrimaryLight]];\n   border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n.popup hr {\n color: [[ColorPalette::PrimaryDark]];\n background: [[ColorPalette::PrimaryDark]];\n    border-bottom: 1px;\n}\n\n.listBreak div{\n border-bottom: 1px solid [[ColorPalette::PrimaryDark]];\n}\n\n.popup li.disabled {\n    color: [[ColorPalette::PrimaryMid]];\n}\n\n.popup li a, .popup li a:visited {\n color: [[ColorPalette::TertiaryPale]];\n    border: none;\n}\n\n.popup li a:hover {\n   background: [[ColorPalette::PrimaryDark]];\n    color: [[ColorPalette::Background]];\n  border: none;\n}\n\n.tiddler .defaultCommand {\n font-weight: bold;\n}\n\n.shadow .title {\n    color: [[ColorPalette::TertiaryDark]];\n}\n\n.title {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.subtitle {\n color: [[ColorPalette::TertiaryDark]];\n}\n\n.toolbar {\n   color: [[ColorPalette::PrimaryMid]];\n}\n\n.tagging, .tagged {\n    border: 1px solid [[ColorPalette::TertiaryPale]];\n background-color: [[ColorPalette::TertiaryPale]];\n}\n\n.selected .tagging, .selected .tagged {\n   background-color: [[ColorPalette::TertiaryLight]];\n    border: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n.tagging .listTitle, .tagged .listTitle {\n  color: [[ColorPalette::PrimaryDark]];\n}\n\n.tagging .button, .tagged .button {\n       border: none;\n}\n\n.footer {\n color: [[ColorPalette::TertiaryLight]];\n}\n\n.selected .footer {\n color: [[ColorPalette::TertiaryMid]];\n}\n\n.sparkline {\n  background: [[ColorPalette::PrimaryPale]];\n    border: 0;\n}\n\n.sparktick {\n background: [[ColorPalette::PrimaryDark]];\n}\n\n.error, .errorButton {\n   color: [[ColorPalette::Foreground]];\n  background: [[ColorPalette::Error]];\n}\n\n.warning {\n color: [[ColorPalette::Foreground]];\n  background: [[ColorPalette::SecondaryPale]];\n}\n\n.cascade {\n background: [[ColorPalette::TertiaryPale]];\n   color: [[ColorPalette::TertiaryMid]];\n border: 1px solid [[ColorPalette::TertiaryMid]];\n}\n\n.imageLink, #displayArea .imageLink {\n  background: transparent;\n}\n\n.viewer .listTitle {list-style-type: none; margin-left: -2em;}\n\n.viewer .button {\n    border: 1px solid [[ColorPalette::SecondaryMid]];\n}\n\n.viewer blockquote {\n  border-left: 3px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer table {\n  border: 2px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer th, thead td {\n    background: [[ColorPalette::SecondaryMid]];\n   border: 1px solid [[ColorPalette::TertiaryDark]];\n color: [[ColorPalette::Background]];\n}\n\n.viewer td, .viewer tr {\n   border: 1px solid [[ColorPalette::TertiaryDark]];\n}\n\n.viewer pre {\n border: 1px solid [[ColorPalette::SecondaryLight]];\n   background: [[ColorPalette::SecondaryPale]];\n}\n\n.viewer code {\n color: [[ColorPalette::SecondaryDark]];\n}\n\n.viewer hr {\n    border: 0;\n    border-top: dashed 1px [[ColorPalette::TertiaryDark]];\n    color: [[ColorPalette::TertiaryDark]];\n}\n\n.highlight, .marked {\n    background: [[ColorPalette::SecondaryLight]];\n}\n\n.editor input {\n   border: 1px solid [[ColorPalette::PrimaryMid]];\n}\n\n.editor textarea {\n  border: 1px solid [[ColorPalette::PrimaryMid]];\n   width: 100%;\n}\n\n.editorFooter {\n    color: [[ColorPalette::TertiaryMid]];\n}\n\n/* 

有人知道发生了什么吗?

在此先感谢您的帮助。

美国

请您参考如下方法:

很难确定,但查看您发布的来源,您的 StyleSheetColors 值中有一个领先的 /*{{{*/\n 。我之前没有使用过 config.js(所以这可能还很遥远),但是检查 here我没有看到相同的领导者(该示例包含 \n,所以我假设这是正常的)。您是否手动将 /*{{{*/\n 添加到您的代码中?从外观上看,您不需要在值前加上大括号(也不需要用大括号关闭它),因此我建议将其视为普通样式表并将其从 StyleSheetColors 的开头删除> 值和末尾的 /*}}}*/。