F2E开源项目访问内容页面爆500内部错误

开源项目 skyz 发表于 3 年前最后回复来自 qq2850071112 2 年前

F2E开源项目访问内容页面爆500内部错误,求解原因.

报错日志:

Traceback (most recent call last):
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/tornado-2.0-py2.7.eg                                                                                                                                                             g/tornado/web.py", line 927, in _execute
    getattr(self, self.request.method.lower())(*args, **kwargs)
  File "/var/www/web/handler/topic.py", line 105, in get
    self.render("topic/view.html", **template_variables)
  File "/var/www/web/handler/base.py", line 70, in render
    html = self.render_string(template_name, **template_vars)
  File "/var/www/web/handler/base.py", line 79, in render_string
    return template.render(**template_vars)
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/jinja2/environment.p                                                                                                                                                             y", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/jinja2/environment.p                                                                                                                                                             y", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "templates/topic/view.html", line 1, in top-level template code
    {% extends 'snippet/layout.html' %}
  File "templates/snippet/layout.html", line 106, in top-level template code
    {% block main %}{% endblock %}
  File "templates/topic/view.html", line 113, in block "main"
    {{ topic.content|markdown|content_process }}
  File "/var/www/web/helper.py", line 145, in markdown
    return markdown(content, extensions = ['codehilite', 'fenced_code', 'mat                                                                                                                                                             hjax'], safe_mode = 'escape')
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/markdown/__init__.py                                                                                                                                                             ", line 460, in markdown
    md = Markdown(*args, **kwargs)
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/markdown/__init__.py                                                                                                                                                             ", line 154, in __init__
    configs=kwargs.get('extension_configs', {}))
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/markdown/__init__.py                                                                                                                                                             ", line 180, in registerExtensions
    ext = self.build_extension(ext, configs.get(ext, {}))
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/markdown/__init__.py                                                                                                                                                             ", line 261, in build_extension
    return module.makeExtension(**configs)
  File "/var/www/web/mdx_mathjax.py", line 21, in makeExtension
    return MathJaxExtension(configs)
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/markdown/extensions/                                                                                                                                                             __init__.py", line 28, in __init__
    self.setConfigs(args[0])
  File "/usr/local/py-2.7.6/lib/python2.7/site-packages/markdown/extensions/                                                                                                                                                             __init__.py", line 75, in setConfigs
    for key, value in items:
TypeError: 'NoneType' object is not iterable
共收到2条回复
skyz 3 年前 #1

会不会是 markdown 版本太高了的问题?

skyz 3 年前 #2

已解决. markdown默认安装版本高了的原因.降级处理即可

先卸载旧版本:

pip uninstall markdown

然后指定安装版本:
pip install 'Markdown<2.0'

登录后即可参与回复