今天在做django rest framework項目的時候,出現如下問題:
md.preprocessors.register(CodeBlockPreprocessor(), 'highlight', 40) AttributeError: 'OrderedDict' object has no attribute 'register'
各種百度未果,直到看到這篇博客:https://blog.csdn.net/weixin_30907523/article/details/102111700
恍然大悟,原來是markdown版本不兼容的問題,解決方法如下:
# 先安裝到最新版本再說
pip uninstall markdown
pip install markdown
然后順利從2.6.11版本更新到3.2.1版本,問題解決!

