0
我是新來的Python和我的代碼給了我一個語法錯誤,因此沒有運行,我爲人不能弄清楚什麼是語法可以請任何人指出了我嗎?Python的語法錯誤使用Django
當前使用Python 3.3。
我的代碼
from django.conf.urls import patterns, include, url
from django.views.generic import ListView
from blog.models import Post
urlpatterns = patterns('',
url(r'^'), ListView.as_view(
queryset = Post.objects.all().order_by("-date")[:10],
template_name = "blog.html")),
)
我的編譯器說的語法錯誤是在最後一行,其中)是
感謝
你有一個逗號,然後最後右括號.. –
刪除多餘)後url模式 –