urls.py中的语法错误无效

时间:2017-10-25 03:45:59

标签: python

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
    ]

在urls.py中收到错误。在urls.py中获取错误。在urls.py中获取错误

1 个答案:

答案 0 :(得分:-1)

该行末尾有一个逗号。删除它

url(r'^contact/$',TemplateView.as_view(template_name='contact.html')),#ERROR