Django 中的语法错误
是什么导致了 urls.py 中的语法错误?
它说
syntax error at Line 27[(r'^xd_receiver\.html$',.....] in ursl.py.
我无法弄清楚问题出在哪里。
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'),
)
What's causing the syntax error in this urls.py ?
It says
syntax error at Line 27[(r'^xd_receiver\.html
I can't figure out where the problem is.
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/
,.....] in ursl.py.
I can't figure out where the problem is.
,'universityDB.universityDetails.views.registrationForm'),
(r'^userDetails/
,.....] in ursl.py.
I can't figure out where the problem is.
,'universityDB.universityDetails.views.userDetails'), (r'^login/ ,.....] in ursl.py.I can't figure out where the problem is.
,'universityDB.universityDetails.views.login'), (r'^userCreated/ ,.....] in ursl.py.I can't figure out where the problem is.
,'universityDB.universityDetails.views.userCreated'), (r'^forgotPassword/ ,.....] in ursl.py.I can't figure out where the problem is.
,'universityDB.universityDetails.views.forgotPassword'), (r'^passwordRecovery/ ,.....] in ursl.py.I can't figure out where the problem is.
,'universityDB.universityDetails.views.passwordRecovery'), (r'^accounts/profile', 'universityDB.universityDetails.views.profile'), (r'^xd_receiver\.html ,.....] in ursl.py.I can't figure out where the problem is.
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver'), (r'^login_facebook_connect/ ,.....] in ursl.py.I can't figure out where the problem is.
, 'login_facebook_connect', name='facebook_connect_ajax'), ),.....] in ursl.py.I can't figure out where the problem is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要命名 URL,则必须使用
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')url(...)
函数,即……而不是:
If you want to name your URLs, you must use the
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')url(...)
function, i.e.…rather than: