0
我的urls.py文件是這樣的:Django的網址錯誤:未知說明符P d
urlpatterns = [
url(r'^chat/(?P\d+)/$', views.chatindex_view, name='chatindex_view'),
]
,並在執行的runserver命令我得到這個錯誤:
in regex (regex, six.text_type(e))
django.core.exceptions.ImproperlyConfigured: "^chat/(?P\d+)/$" is not a valid regular expression: unknown specifier: ?P\d
'?P'在您的正則表達式中引入了關鍵字匹配,但是您並沒有真正給出關鍵字。 –