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