我通過入門Django項目,並在本地運行時保持在第一視頻結束時得到一個語法錯誤工作:Django的語法錯誤url.py文件
SyntaxError at/
invalid syntax (urls.py, line 12)
Request Method: GET
Django Version: 1.5
Exception Type: SyntaxError
Exception Value:invalid syntax (urls.py, line 12)
我的urls.py文件是:
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import TemplateView
admin.autodiscover()
urlpatterns = patterns('',
url(r"^$",TemplateView.as_view(template_name="index.html"))
url(r'^admin/', include(admin.site.urls))
)
感謝您的幫助
你錯過了一些逗號。 – mgilson