似乎无法解决此语法错误...需要帮助。非常感谢。
错误:
File "/max/home/urls.py", line 9
re_path(r'^connect/(?P<operation>.+)/(?P<pk>\d+)/$',
^
SyntaxError: invalid syntax
urls.py
from django.urls import path, re_path
from home.views import HomeView
from . import views
app_name='home'
urlpatterns = [
path('', HomeView.as_view(), name='home')
re_path(r'^connect/(?P<operation>.+)/(?P<pk>\d+)/$',
views.change_friends, name='change_friends')
]
答案 0 :(得分:0)
您需要在path('', HomeView.as_view(), name='home')
之后加上逗号