Django错误:?: (2_0.W001) Your URL pattern '^user/' has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path().


Django2.0后urls的配置发生了改变:

转载自:https://blog.csdn.net/SilentWu/article/details/88205831

解决方案:

  • 把url函数换成path

  • 不适用^,$作路由

eg:

2.0以前版本:

2.0以后版本


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM