django中的语法错误

rv_*_*v_k 1 python django django-templates django-models django-urls

导致此urls.py语法错误的原因是什么?

它说

syntax error at Line 27[(r'^xd_receiver\.html$',.....] in ursl.py.
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚问题出在哪里.

  urlpatterns = patterns('',
        # Example:
        # (r'^universityDB/', include('universityDB.foo.urls')),

        # Uncomment the admin/doc line below to enable admin documentation:
        # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
        # Uncomment the next line to enable the admin:
        (r'^admin/', include(admin.site.urls)),
        (r'^registrationForm/$','universityDB.universityDetails.views.registrationForm'),
        (r'^userDetails/$','universityDB.universityDetails.views.userDetails'),
        (r'^login/$','universityDB.universityDetails.views.login'),
        (r'^userCreated/$','universityDB.universityDetails.views.userCreated'),
        (r'^forgotPassword/$','universityDB.universityDetails.views.forgotPassword'),
        (r'^passwordRecovery/$','universityDB.universityDetails.views.passwordRecovery'),     
        (r'^accounts/profile', 'universityDB.universityDetails.views.profile'),   
        (r'^xd_receiver\.html$', direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver'),   
        (r'^login_facebook_connect/$', 'login_facebook_connect', name='facebook_connect_ajax'),

    )
Run Code Online (Sandbox Code Playgroud)

bra*_*ers 5

如果要为URL命名,则必须使用该url(...)功能,即

url(r'^xd_receiver\.html$', direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')
Run Code Online (Sandbox Code Playgroud)

…而不是:

(r'^xd_receiver\.html$', direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')
Run Code Online (Sandbox Code Playgroud)