Django 中的语法错误

发布于 2024-10-31 03:06:19 字数 1340 浏览 0 评论 0原文

是什么导致了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

日暮斜阳 2024-11-07 03:06:19

如果要命名 URL,则必须使用 url(...) 函数,即

url(r'^xd_receiver\.html

……而不是:

(r'^xd_receiver\.html
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')

……而不是:


, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')

……而不是:

If you want to name your URLs, you must use the url(...) function, i.e.

url(r'^xd_receiver\.html

…rather than:

(r'^xd_receiver\.html
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')

…rather than:


, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')
, direct_to_template, {'template': 'xd_receiver.html'}, name='xd_receiver')

…rather than:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文