擅长:python、mysql、java
<p>仅使用空字符串<code>''</code>而不是<code>'^$</code>:</p>
<pre><code>urlpatterns = [
path('', views.article_list),
]
</code></pre>
<p>看看这里的最后一个例子:<a href="https://docs.djangoproject.com/en/3.1/topics/http/urls/#url-namespaces-and-included-urlconfs" rel="nofollow noreferrer">https://docs.djangoproject.com/en/3.1/topics/http/urls/#url-namespaces-and-included-urlconfs</a></p>
<p>*<em>我不知道您使用的是什么django版本,但是对于正则表达式路径,您应该使用<code>re_path()</code><a href="https://docs.djangoproject.com/en/3.1/ref/urls/#django.urls.re_path" rel="nofollow noreferrer">https://docs.djangoproject.com/en/3.1/ref/urls/#django.urls.re_path</a></em></p>