0
我有一個問題,我的urls.py file.it不斷說第16行有一個語法錯誤,一個與登錄視圖(帳戶/登錄).have試圖修復它,但失敗了。我做錯了什麼?django網站不顯示,由於urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.debug import default_urlconf
from django.conf import settings
from django.conf.urls.static import static
#admin.autodiscover()
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'article.views.articles', name='home'),
url(r'^article/', include('article.urls')),
url(r'^accounts/', include('userprof.urls')),
url(r'^$', default_urlconf)
#url(r'^all/$', 'article.views.articles',name='articles'),
url(r'^accounts/login/$', 'brn.views.login'),
url(r'^accounts/auth/$', 'brn.views.auth_view'),
url(r'^accounts/logout/$', 'brn.views.logout'),
url(r'^accounts/loggedin/$', 'brn.views.loggedin'),
url(r'^accounts/invalid/$', 'brn.views.invalid_login'),
url(r'^accounts/register/$', 'brn.views.register_user'),
url(r'^accounts/register_success/$', 'brn.views.register_success'),
# url(r'^search/',SearchView(load_all = False)),
#url(r'^search/', include('haystack.urls')),
]
if settings.DEBUG: urlpatterns += patterns('',
(r'^static/(?P<path>.*)$','django.views.static.serve', {'document_root':settings.MEDIA_ROOT}),
)
你在該行的末尾缺少一個逗號15個 – dnaranjo