项目场景:
Django导入url路径
问题描述
WARNINGS:
?: (2_0.W001) Your URL pattern ‘^xxx/(?P\d+)/KaTeX parse error: Expected group after '^' at position 52: …begins with a '^̲', or ends with…’. This was likely an oversight when migrating to django.urls.path().
原因分析:
用到了正则表达式
解决方案:
修改为
修改为 re_path
同时 导入 re_path
参照:大佬解决