Python URL.py中存在无效语法错误
获取URL.py中的错误。获取URL.py中的错误。获取URL.py中的错误行的末尾有一个逗号。移除它Python URL.py中存在无效语法错误,python,Python,获取URL.py中的错误。获取URL.py中的错误。获取URL.py中的错误行的末尾有一个逗号。移除它 urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', TemplateView.as_view(template_name='home.html')), url(r'^resturants/$', resturant_ListView.as_view(), url(r'^resturants/p
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', TemplateView.as_view(template_name='home.html')),
url(r'^resturants/$', resturant_ListView.as_view(),
url(r'^resturants/punjabi/$', punjabiresturant_ListView.as_view(),
url(r'^resturants/thai/$', thairesturant_ListView.as_view(),
url(r'^about/$', TemplateView.as_view(template_name='about.html')),
url(r'^contact/$',TemplateView.as_view(template_name='contact.html')),#ERROR
]
您至少缺少三个右括号。如果您的编辑器在选择括号时没有突出显示匹配的括号,请使用更好的编辑器。Python列表中的尾随逗号不是任何问题。
url(r'^contact/$',TemplateView.as_view(template_name='contact.html')),#ERROR