django social auth中的url错误

时间:2012-10-02 07:03:30

标签: django django-urls django-facebook

我在我的应用中使用了django social auth,我发现 Page not 发现错误。 我已将它安装在我的应用程序中,并将其放在与我的应用程序并行的项目中。

我还要在我的网址文件中添加网址

url(r'',include('social_auth.urls')),

但是当它向我显示错误时它显示了我的url文件中的url列表以及我在哪里找到了我想要的url。

错误页面如下:

Page not found (404)
Request Method: GET
Request URL:    http://abc.com/login/
Using the URLconf defined in webdev.urls, Django tried these URL patterns, in this order:
^$ [name='home']
^polls/
^admin/doc/
^admin/
^register1/
^edit/
^edit1/
^customerreg/
^checkout/
^checkout1/
^order/
^order1/
^upload/
^upload1/
^product/
^profile/
^logout/
^login/(?P<backend>[^/]+)/$ [name='socialauth_begin']
^complete/(?P<backend>[^/]+)/$ [name='socialauth_complete']
^associate/(?P<backend>[^/]+)/$ [name='socialauth_associate_begin']
^associate/complete/(?P<backend>[^/]+)/$ [name='socialauth_associate_complete']
^disconnect/(?P<backend>[^/]+)/$ [name='socialauth_disconnect']
^disconnect/(?P<backend>[^/]+)/(?P<association_id>[^/]+)/$ [name='socialauth_disconnect_individual']
The current URL, login/, didn't match any of these.

在上面的列表中你可以看到url文件有那个url,但是它没有访问那个??

1 个答案:

答案 0 :(得分:1)

^login/(?P<backend>[^/]+)/$ [name='socialauth_begin']

此网址与http://abc.com/login/不匹配,因为网址格式需要后端参数。

这样的东西会匹配你正在访问的网址,但是那里没有后端参数,所以在视图中你可能想要选择默认的东西。

url(r'^login/$', 'your_view',),
相关问题